Skip to content

Instantly share code, notes, and snippets.

@binwilly
binwilly / settings.json
Created February 19, 2020 18:03
Todo tree config
{
"window.zoomLevel": 0,
"editor.fontSize": 14,
"diffEditor.ignoreTrimWhitespace": true,
"workbench.startupEditor": "newUntitledFile",
"javascript.updateImportsOnFileMove.enabled": "never",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
<?php
$data = array("name" => "Hagrid", "age" => "36");
$data_string = json_encode($data);
$ch = curl_init('http://putsreq.com/4qyR3oP7gpnNXpoPPuh2');
//curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POST, 0);
@binwilly
binwilly / Script
Created May 21, 2014 19:11
Script GEOJSON
// Global variables
var ss = SpreadsheetApp.getActiveSpreadsheet(),
sheet = ss.getActiveSheet(),
activeRange = ss.getActiveRange(),
settings = {};
var geocoders = {
yahoo: {
query: function(query, key) {
return 'http://where.yahooapis.com/geocode?appid=' +
@binwilly
binwilly / css_resources.md
Created May 11, 2014 07:07 — forked from jookyboi/css_resources.md
CSS libraries and guides to bring some order to the chaos.

Libraries

  • 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
  • Compass - Open source CSS Authoring Framework.
  • Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
  • Font Awesome - The iconic font designed for Bootstrap.
  • Zurb Foundation - Framework for writing responsive web sites.
  • SASS - CSS extension language which allows variables, mixins and rules nesting.
  • Skeleton - Boilerplate for responsive, mobile-friendly development.

Guides

@binwilly
binwilly / javascript_resources.md
Created May 11, 2014 07:07 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
#!/bin/bash
#This script generates one export for each year of a Tilemill project to mbtiles format
#Instructions:
#Run using 'bash tilemill-export.sh [project-name]'
#For more info: http://flipside.org/notes/scripted-tilemill-export
#Assumptions
# - stylesheet = style.mss
'''Provides utility functions for encoding and decoding linestrings using the
Google encoded polyline algorithm.
'''
def encode_coords(coords):
'''Encodes a polyline using Google's polyline algorithm
See http://code.google.com/apis/maps/documentation/polylinealgorithm.html
for more information.
@binwilly
binwilly / new_gist_file
Created May 7, 2013 15:09
/dev/null 2>&1
/dev/null 2>&1
Output redirection
The greater-thans (>) in commands like these redirect the program’s output somewhere. In this case, something is being redirected into /dev/null, and something is being redirected into &1.
Standard in, out, and error
There are three standard sources of input and output for a program. Standard input usually comes from the keyboard if it’s an interactive program, or from another program if it’s processing the other program’s output. The program usually prints to standard output, and sometimes prints to standard error. These three file descriptors (you can think of them as “data pipes”) are often called STDIN, STDOUT, and STDERR.