Skip to content

Instantly share code, notes, and snippets.

@staltz
staltz / introrx.md
Last active April 21, 2025 04:15
The introduction to Reactive Programming you've been missing
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active April 21, 2025 10:43
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@brucecoddington
brucecoddington / resources.js
Last active June 27, 2020 14:42
Wrapping $resource with api and data services.
angular.module('app.resources', ['ngResource'])
.factory('api', function ($resource) {
var api = {
defaultConfig : {id: '@id'},
extraMethods: {
'update' : {
method: 'PUT'
}
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@dchapkine
dchapkine / Docker Snippets
Last active June 7, 2022 12:57
Docker Snippets
# Build
IMAGEID=$(cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1) && sudo docker build -t $IMAGEID .
# Run new container
CONTAINER_ID=$(sudo docker run -t -d -p 0.0.0.0:81:80 $IMAGEID)
# Login into running containe. REQUIRES DOCKER >= 1.3
sudo docker exec -it $CONTAINER_ID bash
# !!! DEPRECATED !!! Login into running container. REQUIRES DOCKER < 0.9
@ahmad24
ahmad24 / ajax-skeleton
Created December 8, 2013 09:03
wordpress : ajax skeleton
<SCRIPT TYPE="text/javascript">
var data = {
action: 'boj_myplugin_do_ajax_request',
some_var: 'some value',
other_var: 'other value'
};
jQuery.post( 'http://example.com/wp-admin/admin-ajax.php', data, function( resp ) {
/*
1. process response object 'resp'
2. update part of page
#!/bin/bash
BUCKETNAME="your_s3_bucket"
LOGDIR="/var/log/nginx"
LOGDATE=$(date +"%Y%m%d")
HOST=$(wget -q -O- http://169.254.169.254/latest/meta-data/instance-id)
LOGFILES=("access")
echo "Moving access logs to dated logs.."
@jmoiron
jmoiron / valuer.go
Created October 14, 2013 18:03
Example uses of sql.Scanner and driver.Valuer
package main
import (
"bytes"
"compress/gzip"
"database/sql/driver"
"errors"
"fmt"
"github.com/jmoiron/sqlx"
_ "github.com/mattn/go-sqlite3"
@yanofsky
yanofsky / LICENSE
Last active March 14, 2025 18:19
A script to download all of a user's tweets into a csv
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@trepmal
trepmal / gist:5305893
Last active December 15, 2015 18:39
WordPress priv/nopriv demo
<?php
/*
* Plugin Name: Ajax Test
* Plugin URI: trepmal.com
* Description:
* Version:
* Author: Kailey Lampert
* Author URI: kaileylampert.com
* License: GPLv2 or later
* TextDomain: some-plugin