Skip to content

Instantly share code, notes, and snippets.

View ttimasdf's full-sized avatar

Known Rabbit ttimasdf

View GitHub Profile
From 24b77f1f639727cb02cd0ef5b594aec94daeebfc Mon Sep 17 00:00:00 2001
From: Eduardo Habkost <ehabkost@raisama.net>
Date: Tue, 19 Jun 2012 19:46:52 -0300
Subject: [PATCH 1/3] remove NX_NUMPROCS case
1) NX_NUMPROCS isn't supposed to be an event number, but just the number of
events from NX_FIRSTEVENT to NX_LASTEVENT
2) NX_NUMPROCS is > NX_LASTEVENT, so the "default:" branch already
handles it (and shows a warning)
@csoma
csoma / gist:de71e151607940d6e523
Last active December 22, 2015 17:08
Remove GitHub Wiki page elements before printing

GitHub Wiki updated Bookmarklet (Sep 2014)

Note: Will not work with Firefox, see bug #866522

Wiki - Hides extra panels:


javascript:(function(e,a,g,h,f,c,b,d)%7Bif(!(f=e.jQuery)%7C%7Cg%3Ef.fn.jquery%7C%7Ch(f))%7Bc=a.createElement(%22script%22);c.type=%22text/javascript%22;c.src=%22https://ajax.googleapis.com/ajax/libs/jquery/%22+g+%22/jquery.min.js%22;c.onload=c.onreadystatechange=function()%7Bif(!b&&(!(d=this.readyState)%7C%7Cd==%22loaded%22%7C%7Cd==%22complete%22))%7Bh((f=e.jQuery).noConflict(1),b=1);f(c).remove()%7D%7D;a.documentElement.childNodes%5B0%5D.appendChild(c)%7D%7D)(window,document,%221.3.2%22,function($,L)%7B$('%23header,%20.pagehead,%20.breadcrumb,%20.commit,%20.meta,%20%23footer,%20%23footer-push,%20.wiki-actions,%20%23last-edit,%20.actions,%20.header,%20%23wiki-rightbar,%20.gh-header-actions,%20.sunken-menu-contents,%20.site-footer').remove();%20$('%23files,%20.file').css(%7B%22background%22:%22none%22,%20%22border%22:%22none%22%7D
@martinlindhe
martinlindhe / gdb.rb
Created June 29, 2016 21:51 — forked from Congee/gdb.rb
For gdb to execute python3 script on OSX 10.10 or later
class UniversalBrewedPython < Requirement
satisfy { archs_for_command("python").universal? }
def message; <<-EOS.undent
A build of GDB using a brewed Python was requested, but Python is not
a universal build.
GDB requires Python to be built as a universal binary or it will fail
if attempting to debug a 32-bit binary on a 64-bit host.
EOS
@Takhion
Takhion / build.gradle
Last active December 20, 2017 07:35 — forked from gabrielemariotti/build.gradle
Store APK signing credentials in an external file using Gradle
android {
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
@shvechikov
shvechikov / README.md
Last active July 20, 2018 06:01 — forked from snehesht/Concurrent HTTP Requests with Python3 and asyncio
Concurrent HTTP Requests with Python3 and asyncio

Concurrent HTTP Requests with Python3 and asyncio

http://geekgirl.io/concurrent-http-requests-with-python3-and-asyncio/

My friend who is a data scientist had wipped up a script that made lots (over 27K) of queries to the Google Places API. The problem was that it was synchronous and thus took over 2.5 hours to complete.

Given that I'm currently attending Hacker School and get to spend all day working on any coding problems that interests me, I decided to go about trying to optimise it.

I'm new to Python so had to do a bit of groundwork first to determine which course of action was best.

@evianzhow
evianzhow / shadowsocks-server
Last active April 27, 2019 14:21
shadowsocks-server OpenWRT init.d script
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2016 Jian Chang <aa65535@live.com>
# Copyright (C) 2016 Evian Zhow <evianzhow@gmail.com>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
#
START=90
@meeech
meeech / gist:b2dafdb31f90160e833c
Created June 29, 2015 15:47
pick from whitelist of random themes for oh-my-zsh
#Add to your .zshrc right by ZSH_THEME
#######
# Setup a random theme to load from a list I define
MYZSH_RANDOM_THEMES=(\
're5et' \
'sorin' \
'steeef' \
'dstufft' \
'random' \
@ttscoff
ttscoff / rtftomarkdown.rb
Created October 9, 2012 21:05
Convert RTF/DOC files to Markdown via Textutil
#!/usr/bin/ruby
=begin
Usage: rtftomarkdown.rb FILENAME.rtf
Uses textutil, available on Mac only (installed by default)
Outputs to STDOUT
Notes:
Links are replaced with Markdown references (duplicate links combined).
@Weptun
Weptun / floatsign.sh
Last active January 1, 2022 21:23 — forked from mediabounds/floatsign.sh
Now fix when no entitlements are present.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
# Extension Copyright (c) 2013 Weptun Gmbh
# http://www.weptun.de
#
# Extended by Ronan O Ciosoig January 2012
#
# Extended by Patrick Blitz, April 2013
title date tags
GCMForMojo 的部署与设置
2017-01-21 11:07:03 -0800
GCM
Android

2017年2月6日更新:完善部分内容,更新内容

2017年2月8日更新:发现自己脑抽少写了一步较为关键的步骤,赶紧补上orz,连带解决笔误