Skip to content

Instantly share code, notes, and snippets.

View lailo's full-sized avatar
😀
happy coding

Lailo lailo

😀
happy coding
View GitHub Profile
import React, { Component, createContext } from 'react'
function initStore(store) {
const Context = createContext();
class Provider extends React.Component {
constructor() {
super();
this.state = store.initialState;
}
@adrienjoly
adrienjoly / next-step-for-trello.user.js
Last active October 16, 2016 17:21
Display the next task to be done, on each Trello card. => MOVED TO https://github.com/adrienjoly/chrome-next-track-for-trello
// ==UserScript==
// @name Next Step for Trello cards
// @version 0.4.7
// @homepage http://bit.ly/next-for-trello
// @description Appends the first unchecked checklist item to the title of each card, when visiting a Trello board.
// @match https://trello.com/b/*
// @match http://trello.com/b/*
// @run-at document-start
// ==/UserScript==
@emotality
emotality / duplicate_line_xcode.md
Last active April 6, 2024 04:23
Xcode - Duplicate Line key binding

NOTE (2022-07-09): Xcode finally added this functionality in Xcode 14, please see release notes here:

New Features in Xcode 14 Beta 3
When editing code, the Edit > Duplicate menu item and its corresponding keyboard shortcut now duplicate the selected text — or the line that currently contains the insertion point, if no text is selected. (8614499) (FB5618491)


Xcode line duplicate

Bind keys to duplicate lines in Xcode

@iandundas
iandundas / String+emoji.swift
Last active April 23, 2022 16:30
Random Emoji
// Returns a random Emoji 🌿
extension String{
func randomEmoji()->String{
let range = 0x1F601...0x1F64F
let ascii = range.startIndex + Int(arc4random_uniform(UInt32(range.count)))
let emoji = String(UnicodeScalar(ascii))
return emoji
}
}
@colinmegill
colinmegill / state.html
Created June 19, 2015 17:15
Basic inline styles with state example for CSSConf
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
</style>
<script src="http://fb.me/react-0.12.2.js"></script>
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
</head>
<body>
@charleskorn
charleskorn / superagent.js
Last active September 6, 2021 06:40 — forked from pherris/superagent.js
A Jest mock for superagent. Place in your __mocks__ directory.
'use strict';
var mockDelay;
var mockError;
var mockResponse = {
status: function () {
return 200;
},
ok: true,
get: jest.genMockFunction(),
@haschek
haschek / .jshintrc
Created May 4, 2012 16:08
JSHint Configuration, Strict Edition
{
// --------------------------------------------------------------------
// JSHint Configuration, Strict Edition
// --------------------------------------------------------------------
//
// This is a options template for [JSHint][1], using [JSHint example][2]
// and [Ory Band's example][3] as basis and setting config values to
// be most strict:
//
// * set all enforcing options to true
@incanus
incanus / gist:1439684
Created December 6, 2011 19:56
Script to export Heroku environment variables to the local shell
#!/bin/sh
for x in `heroku config`; do
if [[ $x == HUBOT* ]]; then
name=$x
elif [ $x != '=>' ]; then
value=$x
export $name=$value
fi
done