Skip to content

Instantly share code, notes, and snippets.

# Set 10 second delay off on Hardcore Deathmatch
set scr_dm_playerrespawndelay -1
# Set 10 second delay off on Hardcore Team Deathmatch
set scr_war_playerrespawndelay -1
# Set map (name is the name of the file in /Call of Duty 4/Call of Duty 4 Data/zone/english/) i.e. mp_backlot
map mp_name
# Change gametype to Deathmatch
import requests
from requests_oauthlib import OAuth1
"""
pseudo...
from twython import TwythonStreamHandler
class MyHandler(TwythonStreamHandler):
def on_receive(self, data):
print 'result', data
import json
import requests
from requests_oauthlib import OAuth1
app_key = 'YOUR_APP_KEY'
app_secret = 'YOUR_APP_SECRET'
oauth_token = 'USER_OAUTH_TOKEN'
oauth_token_secret = 'USER_OAUTH_TOKEN_SECRET'
import os
import requests
from requests_oauthlib import OAuth1
auth = OAuth1('*APP_KEY*', '*APP_SECRET*',
'*OAUTH_TOKEN*', '*OAUTH_TOKEN_SECRET*',
signature_type='auth_header')
file_ = open('/path/to/file/image.jpg', 'rb')
howLongAgo: function(created_time){
var created = new Date(created_time).getTime();
var now = new Date();
var posted = (now.getTime()-created)/1000/60;
if(posted > 1 && posted < 2){
return 'about a minute ago';
}else if(posted > 2 && posted < 60){
return Math.floor(posted)+' minutes ago';
>>> for i in xrange(1, 101):
... if (i%3 == 0) and (i%5 == 0):
... print 'FizzBuzz'
... elif (i%3 == 0):
... print 'Fizz'
... elif (i%5 == 0):
... print 'Buzz'
... else:
... print i
...
{
"error": {
"message": "(#604) Invalid application_id in WHERE clause",
"type": "OAuthException",
"code": 604
}
}
@michaelhelmick
michaelhelmick / gist:3238281
Created August 2, 2012 16:13
decoder jpeg not available
curl -O http://www.ijg.org/files/jpegsrc.v8c.tar.gz
tar zxvf jpegsrc.v8c.tar.gz
cd jpeg-8c/
./configure
make
make install
pip install -I PIL
@michaelhelmick
michaelhelmick / gist:3218930
Created July 31, 2012 17:53
Beautiful Lady

A beautiful lady with eyes on fire,

That sparkle and laugh, that can smile and cry,

I love your eyes so clear and true.

Beautiful lady I adore you.


@michaelhelmick
michaelhelmick / sublime_text-user_settings.json
Last active February 24, 2017 15:52
My user settings for Sublime Text
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/Solarized (Light) (SL).tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"fold_buttons": false,
"font_options":
[
"subpixel_antialias"