This file contains hidden or 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 python | |
# -*- coding: utf-8 -*- | |
import requests | |
import urllib2 | |
import time | |
import random | |
from multiprocessing import Pool | |
h1 = { |
This file contains hidden or 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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains hidden or 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 abstract class TypedConverter<TFrom, TTo> : IValueConverter | |
{ | |
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) | |
{ | |
if (value is TFrom) | |
return Convert((TFrom)value); | |
return Convert(default(TFrom)); | |
} |
This file contains hidden or 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 Cache | |
{ | |
static readonly Dictionary<string, object> _cache = new Dictionary<string, object>(); | |
public static T Run<T>(Func<T> func, params object[] prms) | |
{ | |
var key = GetKey(func, prms); | |
if (!_cache.ContainsKey(key) || !(_cache[key] is T)) | |
_cache.Add(key, func()); |
This file contains hidden or 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
for i in {1..50} | |
do | |
git tfs checkin; | |
done |
This file contains hidden or 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
for i in {1..50} | |
do | |
git tfs checkin; | |
done |
This file contains hidden or 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
bool GraphBuilder::append_unsafe_put_obj(ciMethod* callee, BasicType t, bool is_volatile) { | |
if (InlineUnsafeOps) { | |
Values* args = state()->pop_arguments(callee->arg_size()); | |
null_check(args->at(0)); | |
Instruction* offset = args->at(2); | |
#ifndef _LP64 | |
offset = append(new Convert(Bytecodes::_l2i, offset, as_ValueType(T_INT))); | |
#endif | |
Instruction* op = append(new UnsafePutObject(t, args->at(1), offset, args->at(3), is_volatile)); | |
compilation()->set_has_unsafe_access(true); |
This file contains hidden or 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 static class Singleton<T> where T : class | |
{ | |
static volatile T _instance; | |
static object _lock = new object(); | |
static Singleton() | |
{ | |
} | |
public static T Instance |
This file contains hidden or 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
import csv | |
def find_crossing(a, low, mid, high): | |
max_left = 0 | |
max_right = 0 | |
left_sum = -1e308 | |
sum = 0 | |
for i in range(mid, low, -1): | |
sum = sum + a[i][1] |
This file contains hidden or 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
wget -r -l1 -A.mp3 <url> | |
#http://techpatterns.com/forums/about894.html |