- Used Keys:
- Press v
- Move the cursor to end position
- Press d
- Move to cursor on the comma
- Press x
- Move cursor to the p from pickwick
- Press P
- hiccups: With x in step 5 the comma is placed in the buffer.
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 | |
class ServiceContainer implements ArrayAccess { | |
static protected $instance; | |
public $parameters = array(); | |
public function __construct(array $parameters = array()) { | |
$this->parameters = $parameters; |
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 | |
gpush() { | |
branch=`git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` | |
git push origin $branch | |
_url='https://github.com' | |
# add username | |
username=`git config -l | grep user.name | cut -d"=" -f2` | |
_url="$_url/$username" |
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
# colour output for diffs | |
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold | |
frag = magenta bold |
Here we start in the terminal with ghci (interactive Haskell interperter / ghc) First we create P a nice prime number, and 3 a prime root and two input secrets (8bit) Then start doing the Diffie-Hellman key exchange
Because the lazy evaluation in Haskell defining a variable p is only calculated when needed. And as shown when defining keyA everything is OK. but when called the calculations take too long and are terminated..
Prelude> let p = 2^56 - 46
Prelude> let v = 3
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 | |
//if this php version is greater than 5.1 pass | |
echo strtotime('1766-06-04') . '<br />'; | |
if (version_compare(PHP_VERSION, '5.1', '>')) { | |
echo 'we support negative dates'; | |
} else { | |
echo 'we DON'T support negative dates'; | |
} |
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 logging | |
import logging.config | |
console = { | |
'class': 'logging.StreamHandler', | |
'formatter': 'console', | |
'level': 'NOTSET', # log everything!! | |
} | |
logfile = { |
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
package require http | |
namespace eval twitter { | |
variable status_url "http://api.twitter.com/1/statuses/user_timeline/" | |
bind pub -|- "!twitter" twitter::tweet | |
} | |
proc twitter::tweet {nick uhost hand chan argv} { | |
if {[string length $argv] < 1} { |
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 ConfigParser import ConfigParser | |
class LoaderConfig(dict): | |
def __init__(self, config_path, section): | |
_dyn_kwargs = self.load_config(config_path) | |
super(LoaderConfig, self).__init__(_dyn_kwargs[section]) | |
self.__dict__ = self |
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
days = range(16,30) # the days of the month= | |
p = "ALTER TABLE set_videoads_valid ADD IF NOT EXISTS PARTITION (year={year:d}, month={month:d}, day={day:d}, hour={hour:d}) LOCATION 'hdfs://spil-hadoop/datain/set/portal/valid/year={year:04d}/month={month:02d}/day={day:02d}/hour={hour:02d}'; " | |
print "USE datain; " | |
for x in days: | |
for h in range(0,24): | |
print p.format(year=2014, month=7, day=x, hour=h) |
OlderNewer