This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#fadeout { | |
z-index: 50; | |
position: fixed; | |
left: 0; | |
top: 0; | |
right: 0; | |
height: 100px; | |
background: -webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 255)), to(rgba(255, 255, 255, 0))); | |
background: -moz-linear-gradient(top, rgba(255, 255, 255, 255), rgba(255, 255, 255, 0)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@divwith: 1600px; | |
.superdiv { | |
overflow: auto; | |
height: 100%; | |
position: absolute; | |
width: @divwith; | |
margin-left: -(@divwith/2); | |
left: 50%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @ricardo.cc | |
# Multiply each item in a list by 2 | |
[1..10].map (i) -> i*2 | |
# or | |
i * 2 for i in [1..10] | |
# Sum a list of numbers | |
[1..1000].reduce (t, s) -> t + s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSONObject obj = new JSONObject("{interests : [{interestKey:Dogs}, {interestKey:Cats}]}"); | |
List<String> list = new ArrayList<String>(); | |
JSONArray array = obj.getJSONArray("interests"); | |
for(int i = 0 ; i < array.length() ; i++){ | |
list.add(array.getJSONObject(i).getString("interestKey")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static volatile int x = 0; | |
public static void main(String[] args) { | |
LoopingThread t = new LoopingThread(); | |
t.start(); | |
while (true) { | |
x = x++; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -mindepth 1 -maxdepth 1 -type d -exec git --git-dir={}/.git --work-tree=$PWD/{} pull origin master \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$("#tree-container").jstree("create", $("#new_node"), "inside", {"data":"new_node"}, false, true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="sprite"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python2 | |
# Requires: PIL, colormath | |
# | |
# Improved algorithm now automatically crops the image and uses much | |
# better color matching | |
from PIL import Image, ImageChops | |
from colormath.color_objects import RGBColor | |
import argparse | |
import math |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ctime> | |
void f() { | |
using namespace std; | |
clock_t begin = clock(); | |
code_to_time(); | |
clock_t end = clock(); | |
double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC; |
OlderNewer