This file contains hidden or 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
# -*- coding: utf-8 -*- | |
import sys | |
import pytest | |
import datetime | |
from freezegun.api import FakeDate, FakeDatetime | |
real_date = datetime.date | |
real_datetime = datetime.datetime |
This file contains hidden or 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
;; Thanks to tali713 | |
(defun backward-kill-word-or-kill-region () | |
"When no region is active call backward-kill-word, otherwise kill-region. To | |
make it behave like the shell " | |
(interactive) | |
(call-interactively (if (region-active-p) | |
'kill-region | |
'backward-kill-word))) | |
(global-set-key (kbd "C-w") 'backward-kill-word-or-kill-region) |
This file contains hidden or 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
~ $ ghc-pkg check | |
There are problems in package hint-0.3.3.6: | |
Warning: library-dirs: /Users/PuercoPop/.cabal/lib/hint-0.3.3.6/ghc-7.4.2 doesn't exist or isn't a directory | |
Warning: haddock-interfaces: /Users/PuercoPop/.cabal/share/doc/hint-0.3.3.6/html/hint.haddock doesn't exist or isn't a file | |
Warning: haddock-html: /Users/PuercoPop/.cabal/share/doc/hint-0.3.3.6/html doesn't exist or isn't a directory | |
dependency "MonadCatchIO-mtl-0.3.0.5-a4c0491a4a7ed8d485833de290967759" doesn't exist | |
dependency "base-4.5.1.0-47f48c3ae7f8256a66a23e9dfe22eefc" doesn't exist | |
dependency "directory-1.1.0.2-14f8a11152cd2a14287b62d27ca5dbf3" doesn't exist | |
dependency "ghc-7.4.2-d3a9dd85237f3f10ee165730595f5f5d" doesn't exist | |
dependency "ghc-mtl-1.0.1.2-7151af897d6d3639a2be9006df81ce31" doesn't exist |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# To run py.test test.py | |
from datetime import datetime | |
from freezegun import freeze_time | |
class A(object): | |
def __init__(self): | |
self.date = datetime.now() |
This file contains hidden or 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
;; Recursive Process | |
(define (factorial n) | |
(if (= n 1) | |
1 | |
(* n (factorial (- n 1))))) | |
;; Iterative Process | |
(define (factorial n) | |
(fact-iter 1 1 n)) | |
(define (fact-iter product counter max-count) | |
(if (> counter max-count) |
This file contains hidden or 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
(defun backward-kill-word-or-kill-region () | |
"When no region is active call backward-kill-word, otherwise kill-region. To | |
make it behave like the shell " | |
(interactive (list (point) (mark))) | |
(if mark-active | |
(kill-region point mark) | |
(backward-kill-word 1))) |
This file contains hidden or 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
<iframe id="RSIFrame" name="RSIFrame" scrolling="no" width="305" height="280" allowTransparency="true" frameborder="0" marginheight="0" marginwidth="0"></iframe> | |
<script type="text/javascript" src="styles/jquery-1.8.2.min"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
var currentUrl= window.location.pathname; | |
var iframe = document.getElementById("RSIFrame"); | |
var currentPathname = iframe.src | |
$.ajax({ | |
url: "https://forms.netsuite.com/app/site/crm/externalleadpage.nl", | |
method: "GET", |
This file contains hidden or 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
//context of TrackingPixelList.txt | |
var mydata1 = "hello "; | |
var mydata2 = "fox jumps over "; | |
var mydata3 = "the lazy dog"; | |
// end of text file |
This file contains hidden or 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
(ns clj_torrent.bencode | |
(:require [clojure.string :as string])) | |
(defn decode-bstring [bstring] | |
"Decodes a bencoded string. It ensures the length matches the content." | |
(let [[length content] (string/split bstring #":" 2)] | |
(when (= (Integer/parseInt length) (.length content)) | |
content))) | |
(defn decode-binteger [binteger] |
This file contains hidden or 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
(defadvice zap-to-char (after zap-up-to-char-advice (arg char) activate) | |
"Kill up to the ARG'th occurence of CHAR, and leave CHAR. If | |
you are deleting forward, the CHAR is replaced and the point is | |
put before CHAR" | |
(insert char) | |
(if (< 0 arg) (forward-char -1))) |