Skip to content

Instantly share code, notes, and snippets.

View fredeerock's full-sized avatar

Derick Ostrenko fredeerock

View GitHub Profile
@fredeerock
fredeerock / 0_reuse_code.js
Last active August 29, 2015 14:12
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
//////////////////////
//Static Node Server//
//////////////////////
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
time dd if=/dev/zero of=/Volumes/mount/testfile bs=1048576k count=4
@fredeerock
fredeerock / gist:438ac758b45bf2038acc
Last active August 29, 2015 14:01
Enable Screen Sharing through SSH
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -configure -allowAccessFor -allUsers -configure -restart -agent -privs -all
@fredeerock
fredeerock / json to js
Created December 20, 2012 21:15
load json file into javascipt
//http://stackoverflow.com/questions/2177548/load-json-into-variable
var json = (function () {
var json = null;
$.ajax({
'async': false,
'global': false,
'url': my_url,
'dataType': "json",
'success': function (data) {
@fredeerock
fredeerock / mutliplejquery.js
Created December 5, 2012 09:42
load multiple jquery files
<!-- load foundation & colorbox jquery -->
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
var jQuery_1_8_2 = $.noConflict(true);
</script>
<!-- load timeline jquery -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
var jQuery_1_7_2 = $.noConflict(true);
@fredeerock
fredeerock / moveonscroll.js
Created December 5, 2012 08:05
Move DIV on scroll
<script type="text/javascript">
$(window).scroll(function() {
$('.whiteout').css('top', $(this).scrollTop() + "px");
$('.whiteout').css('position', 'absolute');
if($(this).scrollTop() < 100){
$('.whiteout').css('position', 'static');
}
});
</script>
@fredeerock
fredeerock / basic_minim_trigger.pde
Created November 27, 2012 15:56
Use processing to play samples.
import ddf.minim.*;
Minim minim;
AudioSample kick;
AudioSample snare;
int val1 = 0;
void setup() {
minim = new Minim(this);
kick = minim.loadSample( "BD.mp3", 512);