Skip to content

Instantly share code, notes, and snippets.

@poezn
poezn / _.md
Last active August 29, 2015 14:06
Fossil Fuel (as % of total) vs GDP (developed vs developing)
// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi (maintainer)
// - Michael Herf (Pulse Algorithm)
(function(){
// Scroll Variables (tweakable)
@adriancbo
adriancbo / gist:4c9f1b21ffc7bb2e43f6
Created September 15, 2014 03:51
Hardware Accelerate SCSS Mixin
@mixin hw-accelerate {
-webkit-transform: translate3d(0, 0, 0);
-webkit-backface-visibility: hidden;
-webkit-perspective: 1000;
transform: translate3d(0, 0, 0);
backface-visibility: hidden;
}
@besirkurtulmus
besirkurtulmus / gist:85368167d45b1a69facf
Created September 15, 2014 05:08
Valid integer raw_input
'''
Simple way to get valid integer raw_input in Python 2.7
'''
def earn():
try:
userInput = int(raw_input("Enter your earnings:"))
print "you earn: " + str(userInput)
except ValueError:
print "Please reenter an integer"
earn()
@ctdk
ctdk / velikij.go
Last active August 29, 2015 14:06
A sample plugin for gosudar.
package main
// A demonstration of a gosudar plugin. For now, place the compiled binary in /tmp/plugins.
import (
"net"
"net/rpc/jsonrpc"
"os"
)
defmodule Parallel do
def pmap(collection, fun) do
me = self
collection
|> Enum.map(fn (elem) ->
spawn_link fn -> (send me, { self, fun.(elem) }) end
end)
|> Enum.map(fn (pid) ->
receive do { ^pid, result } -> result end
@lantrix
lantrix / powershell_credentials.ps1
Created September 15, 2014 05:33
Powershell Credentials and some uses in remote file manipulation over SMB
$User = 'machine\administrator'
$Password = 'abcd1234!'
$host = 10.0.0.10
$securedPassword = ConvertTo-SecureString $Password -AsPlainText -Force
$Credential = New-Object System.Management.Automation.PSCredential ($User, $securedPassword)
#establish session
$session = New-PSSession -ComputerName $host -Credential $Credential -ErrorAction SilentlyContinue
@ma6174
ma6174 / code.go
Last active August 29, 2015 14:06
code server
package main
import (
"flag"
"log"
"strconv"
"net/http"
)
var code = flag.Int("c", 200, "code")
@v-thomp4
v-thomp4 / gist:3ee8a51cf58c1d3226ad
Last active August 29, 2015 14:06
Install Docker on Linode

Install Docker on Linode (Ubuntu 12.04)

apt-get update
apt-get install linux-virtual grub-legacy-ec2

Find this line in /boot/grub/menu.list:

defoptions=console=hvc0

@manpages
manpages / example.ex
Created September 15, 2014 05:35
Better layot for OTP structure
defmodule ArchJS do
use Application
import ArchJS.Macros.Sup
defsup User, [] do
defsofo Sessions, ArchJS.User.Session
children = [
worker(ArchJS.User.Registry, []),
worker(ArchJS.User.Sessions, [])
]