Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Chris Charlton ccharlton

🎯
Focusing
View GitHub Profile
View createResource.js
import React from "react";
import { Link } from "react-router-dom";
export function createResource(getPromise) {
let cache = {};
let inflight = {};
let errors = {};
function load(key) {
inflight[key] = getPromise(key)
View gist:37c35d4cebad6a0eaf08
ENV='ENV'
SITE='SITEID'
read -sp "Your Pantheon Password: " PASSWORD
if [[ -z "$PASSWORD" ]]; then
echo "Woops, need password"
exit
fi
while [ 1 ]
@rjorgenson
rjorgenson / README.md
Last active Jun 22, 2019 — forked from agnoster/README.md
My ZSH Theme
View README.md

agnoster.zsh-theme

forked by rjorgenson

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
  • NVM
  • RVM
@swichers
swichers / add-mtime-file-url.php
Created Jun 19, 2015
Add mtime to files in Drupal
View add-mtime-file-url.php
<?php
/**
* Implements hook_file_url_alter().
*/
function HOOK_file_url_alter(&$uri) {
// Client is complaining about images not refreshing immediately when the user
// changes one image for another (and the filename stays the same). Using the
// image path flush function doesn't trigger a browser cache refresh for the
@terrehbyte
terrehbyte / UsefulUnityAssets.md
Last active Jul 14, 2021
Useful Open-Source Unity Assets
View UsefulUnityAssets.md

Useful Open-Source Unity Assets

This is a compilation of various open-source Unity plugins, codebases, or utility scripts that may aid in expediting the development process.

Art / Design Tools

ProbePolisher - Light Probe Editor - keijiro

"ProbePolisher is a Unity Editor plugin for editing light probes. It works both on Unity Basic (free) and Unity Pro."

Code
Releases

View bootstrap-sass-mixin-cheatsheet.scss
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
anonymous
anonymous / Default.sublime-theme
Created Sep 5, 2014
Sublime Text 2 Default theme file
View Default.sublime-theme
[
{
"class": "label_control",
"color": [255, 255, 255],
"shadow_color": [24, 24, 24],
"shadow_offset": [0, -1]
},
{
"class": "button_control",
"content_margin": [6, 5, 6, 6],
View gist:1142360ae789e8bf03d9
#!/bin/bash
ENV='dev'
SITE='XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
while [ 1 ]
do
rsync --partial -rlvz --size-only --ipv4 --progress -e 'ssh -p 2222' ./files/* $ENV.$SITE@appserver.$ENV.$SITE.drush.in:files/
if [ "$?" = "0" ] ; then
echo "rsync completed normally"
exit
@silvenon
silvenon / generator-webapp-with-compass.diff
Last active Sep 24, 2015
Changes needed in order to implement Compass back to Yeoman's generator-webapp.
View generator-webapp-with-compass.diff
-sass: {
- files: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'],
- tasks: ['sass:server', 'autoprefixer']
-}
+compass: {
+ files: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'],
+ tasks: ['compass:server', 'autoprefixer']
+}
...
@dimsemenov
dimsemenov / vcl-regex-cheat-sheet
Last active Jul 18, 2021
Regular expression cheat sheet for Varnish (.vcl). Examples of vcl regexp. Found here http://kly.no/varnish/regex.txt (by Kristian Lyngstøl)
View vcl-regex-cheat-sheet
Regular expression cheat sheet for Varnish
Varnish regular expressions are NOT case sensitive. Varnish uses POSIX
regular expressions, for a complete guide, see: "man 7 regex"
Basic matching:
req.url ~ "searchterm"
True if req.url contains "searchterm" anywhere.
req.url == "searchterm"