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
<!doctype html> | |
<html> | |
<body> | |
<canvas width = "300" height = "300" id = "my_Canvas"></canvas> | |
<script> | |
/* Step1: Prepare the canvas and get WebGL context */ | |
var canvas = document.getElementById('my_Canvas'); | |
var gl = canvas.getContext('webgl2'); |
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
import random | |
import ion | |
import time | |
import kandinsky as ks | |
class Problem: | |
@classmethod | |
def generate_class(cls): | |
r = random.random() |
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
from itertools import islice | |
from collections import deque | |
from math import sqrt | |
import time | |
import asyncio | |
def lucas(): | |
yield 2 | |
a = 2 | |
b = 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 edge.transform) | |
(def test-matrix (repeat 9 [1 2 3 4 5 6 7 8 9])) | |
(defn- average-color [colors] | |
(let [s (sum colors) | |
]) | |
(color 2)) | |
(defn avg |
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
{-# LANGUAGE RankNTypes #-} | |
module ScottEncoding where | |
import Data.Monoid | |
data ListS a = ListS { uncons :: forall r. (a -> ListS a -> r) -> r -> r } | |
consS :: a -> ListS a -> ListS a | |
consS x xs = ListS (\f z -> f x xs) |
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
#!/bin/sh | |
# Usage resing.sh Input.p12 Output.p12 | |
# Use at your own risk | |
echo 'Downloading Apple Root Certificate' | |
curl https://developer.apple.com/certificationauthority/AppleWWDRCA.cer > AppleWWDRCA.cer | |
echo 'Please enter original .p12 password' | |
openssl pkcs12 -in $1 -nocerts -out privateKey.pem -passout pass:qwert |
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
-- Big respect to author of the article Apple Push Notifications with Haskell | |
-- http://bravenewmethod.com/2012/11/08/apple-push-notifications-with-haskell/ | |
-- It is actually the same code, simplified for my needs | |
module APN where | |
import qualified Data.ByteString as B | |
import qualified Data.ByteString.Char8 as BC | |
import qualified Data.ByteString.Lazy as BL | |
import qualified Data.ByteString.UTF8 as BU |
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
find ./ -name '*.h' -print -exec sed -i '' -E '/#\import \<UIKit\/UIKit.h\>/d' {} \; | |
find ./ -name '*.h' -print -exec sed -i '' -E '/#\import \<CoreData\/CoreData.h\>/d' {} \; |
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
#import "RACCommand.h" | |
@interface RACCommand (ARLCompletedSignal) | |
@property (nonatomic, readonly) RACSignal *completed; | |
@end |
NewerOlder