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
# Below are examples of how to initialize and use a Twitter::Client object for each Twitter user | |
# Can initialize by passing in Hash of oauth_access information for the authenticated user driving calls | |
# through Twitter4R | |
twitter = Twitter::Client.new(:oauth_access => { | |
:key => ACCESS_KEY, :secret => ACCESS_SECRET }) | |
# Can also initialize by loading in file configuration file and specifying YAML key name to use for user: | |
twitter = Twitter::Client.from_config("file/name/to/config.yml", "key") # YAML file will look like twitter.yml | |
##### STATUS APIs ###### |
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
;; bitops's solution to Find the odd numbers | |
;; https://4clojure.com/problem/25 | |
#(filter | |
(fn [n] (not (= 0 (mod n 2)))) %) |
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; Copyright (c) Rich Hickey. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php) | |
; which can be found in the file CPL.TXT at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
;dimensions of square world |
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/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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 java.io.IOException; | |
import java.lang.reflect.Method; | |
import java.util.AbstractCollection; | |
import java.util.ArrayList; | |
import java.util.EnumSet; | |
import java.util.HashMap; | |
import java.util.Iterator; | |
import java.util.Map; | |
import android.media.AudioManager; | |
import android.media.MediaPlayer; |
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
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns | |
Compress 1K bytes with Zippy 3,000 ns | |
Send 2K bytes over 1 Gbps network 20,000 ns | |
Read 1 MB sequentially from memory 250,000 ns | |
Round trip within same datacenter 500,000 ns | |
Disk seek 10,000,000 ns |
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
(ns sudoku | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
(defn get-square [rows x y] | |
(for [x (range x (+ x 3)) | |
y (range y (+ y 3))] | |
(get-in rows [x y]))) | |
(defn init [vars hints] |
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/env escript | |
%% -*- erlang -*- | |
%%! -smp enable -sname convert_binary_ring -mnesia debug verbose | |
main([RingFile, OutFile]) -> | |
try | |
{ok, Binary} = file:read_file(RingFile), | |
Ring = binary_to_term(Binary), | |
try | |
file:write_file(OutFile, io_lib:format("~p.~n", [Ring])), |
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
var wrapperId = 'wrapperIdOnPage'; | |
var | |
$w = $(window), | |
$wrap = $('#'+wrapperId), | |
followerInitialOffset = $wrap.offset().top, | |
marginTop = 0, | |
$wrap, windowTop, windowBottom, followerHeight, | |
followerTop, followerBottom, followerBottomPosition | |
; |
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
# Task: Implement the rcat utility and get these tests to pass on a system | |
# which has the UNIX cat command present | |
# To see Gregory Brown's solution, see http://github.com/elm-city-craftworks/rcat | |
# Feel free to publicly share your own solutions | |
rrequire "open3" | |
working_dir = File.dirname(__FILE__) | |
gettysburg_file = "#{working_dir}/data/gettysburg.txt" |
OlderNewer