Skip to content

Instantly share code, notes, and snippets.

View zackexplosion's full-sized avatar
🏠
Working from home

Zack zackexplosion

🏠
Working from home
View GitHub Profile
@zackexplosion
zackexplosion / Setting up Google Cloud Storage with CORS for Web Fonts.md
Last active September 16, 2015 02:44 — forked from mhulse/Setting up Google Cloud Storage with CORS for Web Fonts.md
Setting up CORS on Google Cloud Storage: An unofficial quick start guide to serving web fonts from Google's cloud. (I'm sure a lot of this info could be improved... Please leave comments if you have tips/improvements.)

Login:

Google Cloud Storage

You'll want to login using an official Google account (i.e. if this is for your company, use the comapany Gmail account vs. a personal one.)

When logging in, you might be prompted to verify the account; if so, enter your cell number to get a verification e-mail or phone call.

Once verified, you'll have to agree to the terms of service; do that, and click continue.

var is_android = navigator.userAgent.toLowerCase().indexOf('android') !== -1;
var is_ios = /iphone|ipad|ipod/i.test( navigator.userAgent);
var link;
var links = {
android : 'https://play.google.com/store?hl=zh-TW',
ios: 'https://itunes.apple.com/tw/genre/ios/id36?mt=8',
default: 'http://google.com'
};
require "net/http"
require "uri"
require "random-word"
# enter your hook
hook = ""
uri = URI.parse(hook)
@zackexplosion
zackexplosion / gulpfile.js
Created June 21, 2015 05:35
plugins.js not build
// generated on 2015-06-14 using generator-gulp-webapp 1.0.0
import gulp from 'gulp';
import gulpLoadPlugins from 'gulp-load-plugins';
import browserSync from 'browser-sync';
import del from 'del';
import {stream as wiredep} from 'wiredep';
const $ = gulpLoadPlugins();
const reload = browserSync.reload;
@zackexplosion
zackexplosion / gist:8b1b96663a93129c741c
Created June 1, 2015 07:23
simple javascript version cache control
var ENV = 'production';
var version = Date.now();
if(ENV == 'production'){
version = '20150601';
}
var url = 'https://gist.github.com/cstony0917/425c39beb6ec83662e26.js';
$.ajax(url + '?v=' + version);
<?php
$ENV = 'development';
if($ENV == 'production'){
$VERSION = '20150601';
}else{
$VERSION = time();
}
?>
<html>
default: &default
adapter: postgresql
encoding: unicode
host: localhost
# For details on connection pooling, see rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
pool: 5
development:
<<: *default
#include <string.h>
int main(int argc,char*argv[]) {
char CommandBuf[20];
int a,b,sum;
fprintf(stderr,"Please enter a number:");
fgets(CommandBuf,20,stdin);
a = atoi(CommandBuf);
@zackexplosion
zackexplosion / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
var http = require('http');
var base = 'http://www.fighter.com.tw/updata/down_files/';
var patterns = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split('');
// var patterns = "ABC".split('');
var password_length = 2;
var level = 0;
var total_length = Math.pow(patterns.length , password_length);