Skip to content

Instantly share code, notes, and snippets.

View DrCord's full-sized avatar

Cord Slatton DrCord

View GitHub Profile
@jedsundwall
jedsundwall / gist:586144
Created September 18, 2010 23:00
CSS to add commas to items in an unordered list without leaving a comma hanging at the end of the list
ul.tags {
display: inline;
margin: 0;
padding: 0;
}
ul.tags li {
display: inline;
list-style: none;
margin: 0;
@ryanflorence
ryanflorence / static_server.js
Last active April 26, 2024 16:18
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@aemkei
aemkei / LICENSE.txt
Last active June 4, 2024 07:51 — forked from 140bytes/LICENSE.txt
Binary Tetris - 140byt.es
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@jambu
jambu / gmail-scrollbars.css
Created March 9, 2012 02:17 — forked from Cifro/gmail-scrollbars.css
New Gmail like scrollbars for webkit browsers
/* Gmail style scrollbar */
::-webkit-scrollbar {
width: 12px
}
::-webkit-scrollbar-thumb {
border-width: 1px 1px 1px 2px
}
::-webkit-scrollbar-track {
border-width: 0
}
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 7, 2024 15:14
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@netsensei
netsensei / drupal-ajax.php
Created November 7, 2012 11:14
Minimal Drupal Bootstrap for AJAX requests
<?php
/**
* @file
*
* Minimal AJAX page. Call like this:
* $.ajax({
* type: 'GET',
* url: '/drupal-ajax.php?param1=...
* data: {},
@MichalPekala
MichalPekala / .bash_profile
Last active May 17, 2017 21:45
Raspberry Pi .bash_profile
#!/bin/bash
let upSeconds="$(/usr/bin/cut -d. -f1 /proc/uptime)"
let secs=$((${upSeconds}%60))
let mins=$((${upSeconds}/60%60))
let hours=$((${upSeconds}/3600%24))
let days=$((${upSeconds}/86400))
UPTIME=`printf "%d days, %02dh%02dm%02ds" "$days" "$hours" "$mins" "$secs"`
# get the load averages
read one five fifteen rest < /proc/loadavg
@liorkesos
liorkesos / File Stucture
Last active December 17, 2015 01:28
A sequence of files which get called and enable an angular.js app The app structure looks like this
app
index.html
app.js
css/
js/
controllers/
youtubeSearch.js
services/
views/
main.html
@calvinchoy
calvinchoy / PHP - ip and bigint converter.php
Created June 20, 2013 08:38
PHP - ip and bigint converter
<?php
//Helper function to convert bigint to ip adress
function int2ip($intip){
$ipVal = $intip;
$ipArr = array(0 => floor($ipVal/0x1000000) );
$ipVint = $ipVal-($ipArr[0]*0x1000000); // for clarity
$ipArr[1] = ($ipVint & 0xFF0000) >> 16;
$ipArr[2] = ($ipVint & 0xFF00 ) >> 8;
$ipArr[3] = $ipVint & 0xFF;
$ipDotted = implode('.', $ipArr);
@builtbylane
builtbylane / angular-remove-white-space-filter.js
Created October 30, 2013 18:43
AngularJS – filter: removes white space from text. useful for html values that cannot have spaces
/**
* Description:
* removes white space from text. useful for html values that cannot have spaces
* Usage:
* {{some_text | nospace}}
*/
app.filter('nospace', function () {
return function (value) {
return (!value) ? '' : value.replace(/ /g, '');