{"id":16879641,"url":"https://github.com/easycz/til","last_synced_at":"2025-03-19T22:16:38.446Z","repository":{"id":153550057,"uuid":"54581873","full_name":"easyCZ/til","owner":"easyCZ","description":"Today I Learned...","archived":false,"fork":false,"pushed_at":"2017-01-18T23:54:36.000Z","size":29,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-25T04:45:11.585Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/easyCZ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-23T17:59:46.000Z","updated_at":"2017-01-12T09:40:07.000Z","dependencies_parsed_at":"2023-05-19T11:00:17.206Z","dependency_job_id":null,"html_url":"https://github.com/easyCZ/til","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easyCZ%2Ftil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easyCZ%2Ftil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easyCZ%2Ftil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/easyCZ%2Ftil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/easyCZ","download_url":"https://codeload.github.com/easyCZ/til/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244513977,"owners_count":20464602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T15:55:10.431Z","updated_at":"2025-03-19T22:16:38.415Z","avatar_url":"https://github.com/easyCZ.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"Today I learned...\n======\n#### 2017-01-18 To run tests in Rust in `tests` directory which use `src` files, you need to reference the package name\n* `src/lib.rs`\n```\npub fn hello() {\n    println!(\"Hello, world!\");\n}\n```\n* `tests/my_test.rs`\n```\nextern crate hello_world;\n\n#[test]\nfn test_prints_hello() { assert_eq!(\"Hello, world!\", hello_world::hello()); }\n```\nwhere `hello_world` is the project/package name\n\n#### 2017-01-16 Use CMD-Shift-C to open Element selector in Chrome\n\n#### 2017-01-15 Ownership in Rust through a intro_rust() tutorial\n[intro_rust()](http://intorust.com/)\n\n#### 2017-01-14 Learned about the Vinyl industry\n\n#### 2017-01-13 Define a Rust package with `mod`\n```\n[pub] mod my {\n    // Items in modules default to private visibility.\n    fn private_function() {\n        println!(\"called `my::private_function()`\");\n    }\n\n    // Use the `pub` modifier to override default visibility.\n    pub fn function() {\n        println!(\"called `my::function()`\");\n    }\n}\n```\n\n#### 2017-01-12 The first byte of a PNG document is the signature\nThe PNG singature is composed of the following ASCII values:\n* 137\tA byte with its most significant bit set (8-bit character)\n* 80\tP\n* 78\tN\n* 71\tG\n* 13\tCarriage-return (CR) character, a.k.a. CTRL-M or ^M\n* 10\tLine-feed (LF) character, a.k.a. CTRL-J or ^J\n* 26\tCTRL-Z or ^Z\n* 10\tLine-feed (LF) character, a.k.a. CTRL-J or ^J\n\n#### 2017-01-11 It is possible to pack arbitrary content into a PNG file\nIt is then possible to pack HTML/CSS/JS into the content and serve it as ana image. [Arbitrary PNG content](https://news.ycombinator.com/item?id=9319526)\n\n#### 2017-01-10 Add 2^5 (32) to any ASCII uppercase character to obtain the lowercase\nSimilarly, substract 32 from any ASCII lowercase character to obtain the uppercase.\n```\na = chr(ord('A') + 32)\nA = chr(ord('a') - 32)\n```\n\n#### 2016-11-23 Configure [httpie](https://httpie.org/) timeout with a default config\n```\n~/.httpie/config.json\n```\n```\n\"default_options\": [\"--style=fruity\", \"--body\"]\n```\n\n#### 2016-11-22 AWS Lambda Environment Variables\nIt is now possible to specify environment variables in AWS Lambda\n\n#### 2016-11-21 Mockito Argument Captor with Generics\n```\n@Captor\nprivate ArgumentCaptor\u003cPair\u003cString, Account\u003e\u003e accountCaptor;\n\n@Test\npublic void argumentCaptor() {\n  when(service.disableAccount(account.capture()).thenReturn(...);\n  Pair\u003cString, Account\u003e accountArgument = accountCaptor.get();\n  ...\n}\n```\n\n#### 2016-11-18 Pipe input into a `curl` command \n```\necho \"payload\" | curl -d @-\n```\n\n#### 2016-05-12 Easy git directory publish with [git-directory-deploy](https://github.com/X1011/git-directory-deploy)\n\n#### 2016-05-10 Discovered [Elm Lang](http://elm-lang.org/)\n\n#### 2016-05-09 MPI, pthreads and Julia\n\n#### 2016-05-08 Linux insides\n[GitBook](https://www.gitbook.com/book/0xax/linux-insides/details)\n\n#### 2016-05-02 Use git-flow\n[CheatSheet](https://gist.github.com/kristopherjohnson/8979538)\n\n#### 2016-04-26 Use async-await in React Native Redux Action Creators for more win\n```javascript\nasync function makeAction() : Promise\u003cObject\u003e {\n  const data = await Async.get(...);\n  return { type: 'ACTION_TYPE', data };\n}\n```\n\n#### 2016-04-25 Close the current HTML tag (including ReactJS) in Sublime Text\n```\nCMD+ALT+.\n```\n\n#### 2016-04-24 Select All Inside Current Scope in Sublime Text \n```\nCTRL+SHIFT+M\n```\n#### 2016-04-23 List Globally Installed NPM packages\n```bash\nnpm list -g --depth=0\n```\n\n#### 2016-04-22 Spin Infinitely in React Native\n```javascript\nclass SpinningSquare extends React.Component {\n\n  state = {\n    rotation: new Animated.Value(0)\n  }\n  \n  /* Duration drives the speed of each rotation */\n  componentDidMount() {\n    const timingConfig = { toValue: 1, duration: 1000, easing: Easing.linear }\n    this.animation = Animated.timing(this.state.rotation, timingConfig)\n    this._animate()\n  }\n  \n  _animate = () =\u003e {\n    this.state.rotation.setValue(0);  // Needs to be reset after a full rotation\n    this.animation.start(this._animate);  // self as callback onFinished\n  }\n  \n  render() {\n    const rotate = this.state.rotation.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg'] })\n    return (\n      \u003cAnimated.View style={{\n        width: 40,\n        height: 40,\n        backgroundColor: 'red',\n        transform: [{ rotate }]\n      }} /\u003e\n    )\n  }\n}\n```\n\n\n#### 2016-04-13\nLearned some vim commands through `vimtutor`\n\n#### 2016-04-12\nLearned how to use iOS Facebook login with the Facebook SDK\n\n#### 2016-04-11\nHow to use Firebase as a messagining queue with [firebase-queue](https://github.com/firebase/firebase-queue)\n\n#### 2016-04-09\nLoading the BIOS after the power button is pressed on a pc\n\n#### 2016-04-02\nHow to use FP with lodash\n\n#### 2016-03-30\nLearned how exhausting finishing a dissertation is :)\n\n#### 2016-03-28\nHow objects and inheratiance works in Go from [build-web-applications-with-golang](https://www.gitbook.com/book/astaxie/build-web-application-with-golang/details)\n\n#### 2016-03-26\nMemcached performance drastically increases with thread pinning and IRQ pinning.\n\n#### 2016-03-25\nInvestigated how IRQ affinity works. Learned you can obtian the number of interrupts executed on a given CPU core through `cat /proc/interrupt` as well as how setting IRQ Affinity to a given CPU/CPUs works. We can provide the list of values in `/proc/irq/\u003cirq_id\u003e/smp_affinity_list`.\n\n#### 2016-03-24\nLearned about functors, Maybe, Either and IO from [mostly-adequate-guide](https://drboolean.gitbooks.io/mostly-adequate-guide/content/)\n\n#### 2016-03-23\nFunctional programming with JavaScript through the awesome [mostly-adequate-guide](https://drboolean.gitbooks.io/mostly-adequate-guide/content/). \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasycz%2Ftil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feasycz%2Ftil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feasycz%2Ftil/lists"}