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
<?php | |
/* | |
Need to encode given (finished) path and query?, for example | |
'http://example.org:port/path1/path2/data?key1=value1&argument#fragment' (1) | |
or 'scheme://user:password@example.com:port/path1/path2/data?key1=value1&key2=value2#fragment' (2) | |
e.g. this (2) should be encoded: | |
'scheme://'.rawurlencode('user').':'.rawurlencode('password').'@example.com:port/' | |
.rawurlencode('path1').'/'.rawurlencode('path2').'/'.rawurlencode('data') | |
.'?'.htmlentities(urlencode('key1').'='.urlencode('value1').'&'.urlencode('key2').'='.urlencode('value2')) |
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
from PIL import Image, ImageFont, ImageDraw | |
import glob | |
import os | |
import re | |
import time | |
"""""" | |
dir_to_watch_name = './to_watch' | |
watch_every = 10 |
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
<?php | |
// src/App.php | |
namespace Example; | |
class App | |
{ | |
public function redirect($url) | |
{ | |
header('Location: ' . $url, true, 302); | |
die(); |
Note: If you want to use your personal Twitter account to post commits, go to Step 2
- Create a new Twitter account for your commit messages. Example
- Go to http://dev.twitter.com and Sign In with your Twitter account you are posting commit messages to.
- Hover over your username in the top-right corner after signing in and select "My Applications"
- Create a new application
- The name, description, and site can all be whatever you want, but leave Callback URL empty
- Under "Application Settings" click "modify app permissions" next to "Access level"
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
import urllib2 | |
import re | |
import sys | |
from collections import defaultdict | |
from random import random | |
""" | |
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS | |
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE | |
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt" |
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
<NotepadPlus> | |
<UserLang name="Markdown" ext="mkdn mkd md" udlVersion="2.0"> | |
<Settings> | |
<Global caseIgnored="yes" allowFoldOfComments="no" forceLineCommentsAtBOL="no" foldCompact="no" /> | |
<Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments" id="0">00# 00## 00### 00#### 00##### 01 02 03<!-- 04--></Keywords> | |
<Keywords name="Numbers, additional" id="1"></Keywords> | |
<Keywords name="Numbers, prefixes" id="2"></Keywords> |
Let's say you start a project locally, and do some editing.
$ mkdir -p ~/git/foo && cd ~/git/foo
$ touch NEWFILE
Now you decide you want to create a new github repo and track it, but the directory is non-empty so git won't let you clone into it. You can fix this, thusly:
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
<?php | |
/** | |
* File: apigen-hooks.php | |
* | |
* NOTE: this code is used internally in WPGlobus project. | |
* It's a W.I.P. - please use it, but do not forget to adapt for your project. | |
* | |
* @package WPGlobus\APIGen | |
* @author Gregory Karpinsky (@tivnet) | |
*/ |
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
KUTT_HOST="https://kutt.it" | |
KUTT_API_KEY="API_KEY" | |
kutt() { | |
if [[ "$1" == "delete" ]] && [[ -n "$2" ]]; then | |
curl -s -H "X-API-KEY: $KUTT_API_KEY" \ | |
-X DELETE \ | |
"$KUTT_HOST/api/v2/links/$2" | jq | |
elif [[ -z "$1" ]]; then | |
curl -s -H "X-API-KEY: $KUTT_API_KEY" \ | |
"$KUTT_HOST/api/v2/links" | jq |
OlderNewer