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
#!/bin/sh | |
set -o errexit | |
# make sure we're at the root of git repo | |
if [ ! -d .git ]; then | |
echo "Error: must run this script from the root of a git repository" | |
exit 1 | |
fi | |
if [ ! -d "$1/.git" ]; then |
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
(?<ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) - - \[(?<timestamp>.*?)\] "GET (?<request>.*?) (?<httpver>HTTP/1\.\d)" (?<response>\d{3}) (?<response_size>\d{1,}) "(?<referer>.*?)" "(?<client>.*?)" |
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 | |
include('words_example.php'); //Our Datasetm $data | |
$patSize = 5; | |
foreach( $data as $word ) { | |
for( $i = 0; $i <= strlen( $word ) - 2; $i++ ) { | |
$j = 0; | |
$str = ''; |
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 | |
header("Content-Type: image/jpg"); | |
passthru('/usr/local/bin/imagesnap -'); |
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
<?xml version="1.0" encoding="utf-8"?><root version="6000"><sect_php><name_0>Whitespace</name_0><color_0>clNone</color_0><fontcolor_0>clTeal</fontcolor_0><isbold_0>0</isbold_0><isunderline_0>0</isunderline_0><isitalic_0>0</isitalic_0><isstikeout_0>0</isstikeout_0><name_1>String</name_1><color_1>clNone</color_1><fontcolor_1>$003CCE94</fontcolor_1><isbold_1>0</isbold_1><isunderline_1>0</isunderline_1><isitalic_1>0</isitalic_1><isstikeout_1>0</isstikeout_1><name_2>Comment</name_2><color_2>clNone</color_2><fontcolor_2>$00AEAEAE</fontcolor_2><isbold_2>0</isbold_2><isunderline_2>0</isunderline_2><isitalic_2>1</isitalic_2><isstikeout_2>0</isstikeout_2><name_3>Text</name_3><color_3>clNone</color_3><fontcolor_3>clNone</fontcolor_3><isbold_3>0</isbold_3><isunderline_3>0</isunderline_3><isitalic_3>0</isitalic_3><isstikeout_3>0</isstikeout_3><name_4>Reserved words</name_4><color_4>clNone</color_4><fontcolor_4>$004848E1</fontcolor_4><isbold_4>1</isbold_4><isunderline_4>0</isunderline_4><isitalic_4>0</isitalic_4><isstikeou |
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
CONCAT(IF(ASCII(LEFT(products_model,1))>57,LEFT(products_model,1),'0'),IF(ASCII(RIGHT(products_model,1))>57,LPAD(products_model,10,'0'),LPAD(CONCAT(products_model,'-'), 10,'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
/** | |
* Method for taking a string formatted as a css selector and breaking it down into id/classes/attributes/in-line styles | |
* to use in the creatin of an element. I.E. "#id.class.class2[attribute=value]{ border: 1px solid blue; }" | |
* | |
* @ignore this is the original regex i wrote, which was awesome, but broke on some edge cases ... | |
* "!(\#(.+?)(\.|\[|\{)){1,}!" => ' id="$2" $3', //ID | |
* "!(\.(.*?)(\[|\{)){1,}!" => ' class="$2" $3', //CLASS | |
* "!\[(.*?)=([^\[]*)\]!" => ' $1="$2" ', //ATTRS | |
* "!\{(.*)\}!" => ' style="$1" ', //INLINE STYLE | |
* "!\.([a-zA-Z_]+[\w\-]*)!" => ' $1', //SPECIFIC CLASSES |
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/php -q | |
<?php | |
$handle = @fopen("B-large-practice.in", "r"); | |
$count = fgets($handle); | |
for( $i = 1; $i <= $count; $i++ ) { | |
echo 'Case #' . $i . ': ' . implode(' ', array_reverse(explode(' ', trim(fgets($handle)))) ) . PHP_EOL; | |
} |
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
Imports System.Windows.Shell | |
Class Application | |
Public Sub New() | |
Dim jl As New JumpList | |
JumpList.SetJumpList(Application.Current, jl) | |
Dim SaveAs As New JumpTask | |
SaveAs.ApplicationPath = System.Reflection.Assembly.GetExecutingAssembly.Location() |
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
// ==UserScript== | |
// @name Penny Arcade Line-Height Correction | |
// @author Jesse G. Donat | |
// @namespace http://donatstudios.com/ | |
// @match http://www.penny-arcade.com/* | |
// @description Fixes Penny-Arcades stupid unreadable lineheight | |
// ==/UserScript== | |
document.getElementsByClassName('body')[0].style.lineHeight='1.6em'; |
OlderNewer