Skip to content

Instantly share code, notes, and snippets.

@rimatla
rimatla / TSLInt-Prettier-CreateReactApp-TypeScript-setup.md
Last active May 17, 2024 09:44
Create React App + TypeScript Linting with TSLint and Prettier setup on VSCode

Ps: The current setup was done on 01-04-19

Project Dependency Versions at the time 👇

  "react": "^16.7.0",
  "react-dom": "^16.7.0",
  "react-scripts": "2.1.3",
  "typescript": "^3.2.2"
  "tslint": "^5.12.0",
  "tslint-config-prettier": "^1.17.0",
@chicken-suop
chicken-suop / regenMac
Last active May 12, 2022 20:09
Disassociate, generate new mac, reconnect
#!/bin/bash
# arp -ani en0
# ^^ Get MAC addrs of other users on same network.
# Change en0 to your network interface.
# On macos, this can be seen through:
# networksetup -listallhardwareports
# sudo ifconfig en0 ether $MAC
# ^^ replace $MAC with an addr from above command
@dabit3
dabit3 / React Native Easings
Created August 1, 2016 03:38
React Native Easing animations
'use strict';
var React = require('react-native');
var {
AppRegistry,
StyleSheet,
Text,
View,
Easing,
Animated,
@alexbepple
alexbepple / index.js
Last active November 2, 2018 12:46
Background image and scrollview on React Native, based on http://stackoverflow.com/questions/35013573
import React, {AppRegistry, Text, View, Dimensions, ScrollView, Image} from 'react-native'
const window = Dimensions.get('window')
const imageDimensions = {
height: window.height,
width: window.width
}
var SampleApp = React.createClass({
render: function () {
@sorenlouv
sorenlouv / cpu-intensive.js
Last active December 19, 2023 06:00
A CPU intensive operation. Use to test imitate blocking code, test WebWorkers etc.
function mySlowFunction(baseNumber) {
console.time('mySlowFunction');
let result = 0;
for (var i = Math.pow(baseNumber, 7); i >= 0; i--) {
result += Math.atan(i) * Math.tan(i);
};
console.timeEnd('mySlowFunction');
}
mySlowFunction(8); // higher number => more iterations => slower
@staltz
staltz / introrx.md
Last active July 15, 2024 15:43
The introduction to Reactive Programming you've been missing
@mrkline
mrkline / c_sharp_for_python.md
Last active June 23, 2024 14:46
An intro to C# for a Python developer. Made for one of my coworkers.

C# For Python Programmers

Syntax and core concepts

Basic Syntax

  • Single-line comments are started with //. Multi-line comments are started with /* and ended with */.

  • C# uses braces ({ and }) instead of indentation to organize code into blocks. If a block is a single line, the braces can be omitted. For example,

@jareware
jareware / SCSS.md
Last active July 1, 2024 09:25
Advanced SCSS, or, 16 cool things you may not have known your stylesheets could do

⇐ back to the gist-blog at jrw.fi

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the aweso