Skip to content

Instantly share code, notes, and snippets.

@joakin
joakin / hack.sh
Created April 8, 2012 14:48 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2337706/hack.sh | sh
#
@guifromrio
guifromrio / nodejs-ubuntu-bind-port-80.md
Last active January 10, 2024 22:47
Allow Node.js to bind to privileged ports without root access on Ubuntu

How to: Allow Node to bind to port 80 without sudo

TL;DR

Only do this if you understand the consequences: all node programs will be able to bind on ports < 1024

sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/node

Important: your node location may vary. Use which node to find it, or use it directly in the command:

@reggi
reggi / glob-up-and-running.md
Last active March 16, 2022 16:47
A tutorial on how to get started using glob patterns in your terminal. #writing

Glob Up and Running

To test a glob pattern go over to globtester and play around with creating your own file structure online, it's super easy to get started that way.

If you want to test out a glob pattern in the terminal use echo followed by the pattern, for instance.

echo **/*.js
@manekinekko
manekinekko / regex-es6-imports.js
Last active February 1, 2024 16:05
A regular Expression to parse ECMAScript6 import syntax
let regex = `import
(?:
["'\s]*
([\w*{}\n, ]+)
from\s*
)?
["'\s]*
([@\w/_-]+)
["'\s]*
;?
@jdlrobson
jdlrobson / profile_getText.php
Created March 10, 2016 22:52
profile_getText.php
<?php
require_once( '../../includes/libs/ReplacementArray.php' );
require_once( '../../includes/HtmlFormatter.php' );
function wfIsWindows () { return false; };
require_once( 'includes/MobileFormatter.php' );
const NUMBER_RUNS = 100;
$filenames = array(
@tduarte
tduarte / publish-ghpages.md
Last active May 18, 2024 13:52
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
import React, { PropTypes, Component } from 'react'
import { getRef, listToArray } from '../utils/firebase'
import { ErrorMessage, Loading } from '../Theme'
/*
```js
<Ref path="/somewhere">
{({ error, loaded, value }) => (
// `value` is an object w/ keys
@jdlrobson
jdlrobson / pixies.py
Last active February 20, 2019 19:35
#!/usr/bin/env python
'''
Copyright [2017] [Jon Robson]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
import React from 'react';
import lively from 'lively';
// Global registry and resize handler
let _registeredInstances = [];
function register(inst) {
if (_registeredInstances.length === 0) {
window.addEventListener('resize', onResize);
}
@mfeineis
mfeineis / ElmFsaPorts.elm
Last active March 6, 2018 01:53
This is a "minimal" example for integrating Elm with Flux-Standard-Actions of ReactJS fame (https://ellie-app.com/d6C53Vf3Pa1/0).
port module ElmFsaPorts exposing (main)
import Html exposing (Html, text)
import Json.Decode as Decode exposing (Decoder, Value)
import Json.Encode as Encode
port fromElm : Value -> Cmd msg