Create Bookmarklet (browser bookmark that executes Javsacript) to copy a given text to Clipboard.
This is the base javascript:
(function (text) {
var node = document.createElement('textarea')
var selection = document.getSelection()
SELECT | |
cols.column_name, | |
cols.data_type, | |
cols.character_maximum_length, | |
cols.column_default, | |
cols.is_nullable::boolean, | |
constr.constraint_type, | |
pg_catalog.col_description(cls.oid, cols.ordinal_position::int)::jsonb | |
FROM | |
pg_catalog.pg_class cls, |
{% capture whitespace %} | |
{% assign wholeNum = include.number | divided_by: include.divsor %} | |
{% assign remainder = wholeNum | times: include.divsor | minus: include.number | times: -1 %} | |
{% capture output %}{{ wholeNum }}.{% endcapture %} | |
{% for i in (1..include.decimals) %} | |
{% assign newNumer = remainder | times: 10 %} | |
{% assign workspace = newNumer | divided_by: include.divsor %} | |
{% assign remainder = workspace | times: include.divsor | minus: newNumer | times: -1 %} |
postgres: | |
image: postgres:9.4 | |
volumes: | |
- ./init.sql:/docker-entrypoint-initdb.d/init.sql |
There are two types of markup in Liquid: Output and Tag.
{{ matched pairs of curly brackets (ie, braces) }}
The Open Source Mentorship Program is a partnership between Code for America brigades and Girl Develop It chapters. The "Summer of Open Source" was piloted in Philadelphia over the summer of 2014. Met with great excitement from the success of the experiment, CfA and GDI cemented the partnership so that other brigades and chapters across the country might replicate and extend the impact of this collaboration.
In the summer of 2015, Philadelphia once again launched osmp. This guidebook is the result of their experience and includes both successes and opportunities for improvement. It is as comprehensive as possible, but the intention is for subsequent programs to fork and bu
This is a list of examples and articles, in roughly the order you should follow them, to show and explain how promises work and why you should use them. I'll probably add more things to this list over time.
This list primarily focuses on Bluebird, but the basic functionality should also work in ES6 Promises, and some examples are included on how to replicate Bluebird functionality with ES6 promises. You should still use Bluebird where possible, though - they are faster, less error-prone, and have more utilities.
I'm available for tutoring and code review :)
You may reuse all gists for any purpose under the WTFPL / CC0 (whichever you prefer).
You should almost never actually use this. The same applies to fs.stat
(when used for checking existence).
Checking whether a file exists before doing something with it, can lead to race conditions in your application. Race conditions are extremely hard to debug and, depending on where they occur, they can lead to data loss or security holes. Using the synchronous versions will not fix this.
Generally, just do what you want to do, and handle the error if it doesn't work. This is much safer.
ENOENT
error when it doesn't exist.wx
or ax
, and handle the error when the file already exists.<?php | |
require('mysql.php'); // see https://gist.github.com/paxmanchris/f5d4b94f67a8acd8cefc | |
$me = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME']; | |
$sso_secret = 'YOUR_SSO_PROVIDER_KEY_HERE'; | |
$discourse_url = 'http://example.com'; | |
if(!empty($_GET) and isset($_GET['sso'])){ |
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 |