Skip to content

Instantly share code, notes, and snippets.

@ryantbd
ryantbd / react-native-gitignore
Created April 4, 2015 07:54
react-native-gitignore
# Most part of this file is created by https://www.gitignore.io
### Node ###
# Logs
logs
*.log
# Runtime data
pids
*.pid
@ungoldman
ungoldman / curl_post_json.md
Last active April 15, 2024 14:46
post a JSON file with curl

How do you POST a JSON file with curl??

You can post a json file with curl like so:

curl -X POST -H "Content-Type: application/json" -d @FILENAME DESTINATION

so for example:

@niw
niw / Molokai.icls
Last active November 19, 2019 18:56
Molokai color scheme for IntelliJ IDEA. Put this file into ~/Library/Preferences/<Path to each IntelliJ Platforms>/colors.
<scheme name="Molokai" version="142" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="14" />
<option name="EDITOR_FONT_NAME" value="Menlo" />
<colors>
<option name="ADDED_LINES_COLOR" value="a6e22e" />
<option name="ANNOTATIONS_COLOR" value="66d9ef" />
<option name="ANNOTATIONS_MERGED_COLOR" value="a6e22e" />
<option name="CARET_COLOR" value="f8f8f2" />
<option name="CARET_ROW_COLOR" value="232526" />
@gnomeontherun
gnomeontherun / gist:3955552
Created October 25, 2012 21:30
Notes about Node.js as I learn

Day 2

  • npm install package --save will auto add to dependencies
  • Use an MVC structure
  • You can have dependencies just for development
  • There are a few higher level frameworks (Tower.js, Geddy, Derby, Locomotive.js) but it seems wise to keep it simple
  • Use an MVC structure
  • The power of node modules cannot be understated. On the other hand it seems best to limit as much as possible to only required modules
  • Get your code clearly organized from the start
  • Use an MVC structure
@stonegao
stonegao / HttpServer.scala
Created June 14, 2012 02:53 — forked from soheilhy/HttpServer.scala
Routing based on HTTP method in Finagle
import com.twitter.finagle.http.path._
import com.twitter.finagle.http.service.RoutingService
import com.twitter.finagle.http.{Request, Response, RichHttp, Http}
import com.twitter.finagle.{Service, SimpleFilter}
import org.jboss.netty.handler.codec.http._
import org.jboss.netty.handler.codec.http.HttpResponseStatus._
import org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1
import org.jboss.netty.buffer.ChannelBuffers.copiedBuffer
import org.jboss.netty.util.CharsetUtil.UTF_8
import com.twitter.util.Future
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@nikcub
nikcub / chrome.refresh.sh
Created October 31, 2011 03:05
Chrome Refresh
#!/bin/bash
# Chrome Refresh
#
# nik cubrilovic - nikcub.appspot.com
#
# Simple applescript browser reloader for Google Chrome. It will either open a
# new tab with the url passed in as an argument or refresh an existing tab.
#
# Link this up with watchr to auto-refresh browser windows when you save files
@benfoxall
benfoxall / instructions.md
Created May 20, 2011 09:46
apache vhosts
@mattattui
mattattui / gist:879249
Created March 21, 2011 10:08
Convert named HTML entities to numeric for XML compatibility
<?php
/* html_convert_entities($string) -- convert named HTML entities to
* XML-compatible numeric entities.
*/
function html_convert_entities($string) {
return preg_replace_callback('/&([a-zA-Z][a-zA-Z0-9]+);/S',
'convert_entity', $string);
}
@trevmex
trevmex / bst.js
Created February 11, 2011 05:38
A simple binary search tree in JavaScript
/*
* File: bst.js
*
* A pure JavaScript implementation of a binary search tree.
*
*/
/*
* Class: BST
*