GithubHelp home page GithubHelp logo

til's Introduction

Today I learned...

2017-01-18 To run tests in Rust in tests directory which use src files, you need to reference the package name

  • src/lib.rs
pub fn hello() {
    println!("Hello, world!");
}
  • tests/my_test.rs
extern crate hello_world;

#[test]
fn test_prints_hello() { assert_eq!("Hello, world!", hello_world::hello()); }

where hello_world is the project/package name

2017-01-16 Use CMD-Shift-C to open Element selector in Chrome

2017-01-15 Ownership in Rust through a intro_rust() tutorial

intro_rust()

2017-01-14 Learned about the Vinyl industry

2017-01-13 Define a Rust package with mod

[pub] mod my {
    // Items in modules default to private visibility.
    fn private_function() {
        println!("called `my::private_function()`");
    }

    // Use the `pub` modifier to override default visibility.
    pub fn function() {
        println!("called `my::function()`");
    }
}

2017-01-12 The first byte of a PNG document is the signature

The PNG singature is composed of the following ASCII values:

  • 137 A byte with its most significant bit set (8-bit character)
  • 80 P
  • 78 N
  • 71 G
  • 13 Carriage-return (CR) character, a.k.a. CTRL-M or ^M
  • 10 Line-feed (LF) character, a.k.a. CTRL-J or ^J
  • 26 CTRL-Z or ^Z
  • 10 Line-feed (LF) character, a.k.a. CTRL-J or ^J

2017-01-11 It is possible to pack arbitrary content into a PNG file

It is then possible to pack HTML/CSS/JS into the content and serve it as ana image. Arbitrary PNG content

2017-01-10 Add 2^5 (32) to any ASCII uppercase character to obtain the lowercase

Similarly, substract 32 from any ASCII lowercase character to obtain the uppercase.

a = chr(ord('A') + 32)
A = chr(ord('a') - 32)

2016-11-23 Configure httpie timeout with a default config

~/.httpie/config.json
"default_options": ["--style=fruity", "--body"]

2016-11-22 AWS Lambda Environment Variables

It is now possible to specify environment variables in AWS Lambda

2016-11-21 Mockito Argument Captor with Generics

@Captor
private ArgumentCaptor<Pair<String, Account>> accountCaptor;

@Test
public void argumentCaptor() {
  when(service.disableAccount(account.capture()).thenReturn(...);
  Pair<String, Account> accountArgument = accountCaptor.get();
  ...
}

2016-11-18 Pipe input into a curl command

echo "payload" | curl -d @-

2016-05-12 Easy git directory publish with git-directory-deploy

2016-05-10 Discovered Elm Lang

2016-05-09 MPI, pthreads and Julia

2016-05-08 Linux insides

GitBook

2016-05-02 Use git-flow

CheatSheet

2016-04-26 Use async-await in React Native Redux Action Creators for more win

async function makeAction() : Promise<Object> {
  const data = await Async.get(...);
  return { type: 'ACTION_TYPE', data };
}

2016-04-25 Close the current HTML tag (including ReactJS) in Sublime Text

CMD+ALT+.

2016-04-24 Select All Inside Current Scope in Sublime Text

CTRL+SHIFT+M

2016-04-23 List Globally Installed NPM packages

npm list -g --depth=0

2016-04-22 Spin Infinitely in React Native

class SpinningSquare extends React.Component {

  state = {
    rotation: new Animated.Value(0)
  }
  
  /* Duration drives the speed of each rotation */
  componentDidMount() {
    const timingConfig = { toValue: 1, duration: 1000, easing: Easing.linear }
    this.animation = Animated.timing(this.state.rotation, timingConfig)
    this._animate()
  }
  
  _animate = () => {
    this.state.rotation.setValue(0);  // Needs to be reset after a full rotation
    this.animation.start(this._animate);  // self as callback onFinished
  }
  
  render() {
    const rotate = this.state.rotation.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg'] })
    return (
      <Animated.View style={{
        width: 40,
        height: 40,
        backgroundColor: 'red',
        transform: [{ rotate }]
      }} />
    )
  }
}

2016-04-13

Learned some vim commands through vimtutor

2016-04-12

Learned how to use iOS Facebook login with the Facebook SDK

2016-04-11

How to use Firebase as a messagining queue with firebase-queue

2016-04-09

Loading the BIOS after the power button is pressed on a pc

2016-04-02

How to use FP with lodash

2016-03-30

Learned how exhausting finishing a dissertation is :)

2016-03-28

How objects and inheratiance works in Go from build-web-applications-with-golang

2016-03-26

Memcached performance drastically increases with thread pinning and IRQ pinning.

2016-03-25

Investigated 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/<irq_id>/smp_affinity_list.

2016-03-24

Learned about functors, Maybe, Either and IO from mostly-adequate-guide

2016-03-23

Functional programming with JavaScript through the awesome mostly-adequate-guide.

til's People

Contributors

easycz avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.