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
This is my award-winning recipe for margaritas. They've led to more than one good party. | |
The recipe is "paella-style", meaning it's not exact and a lot of eyeballing is required. | |
I recommend tasting throughout, ideally with a sober partner in crime. | |
Tools you'll need: | |
- lemon and lime squeezers OR powerful hands (probably best to get the squeezers, they're no more than $20) | |
- pitcher(s) - this recipe easily makes 2 full pitchers | |
- margarita glasses (or plain old cups) |
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
This is my recipe for (sort of) ramen noodles. There's no broth involved but my vegetarian friends are pretty happy when I make this. Super easy to make and very filling. | |
This recipe assumes that you are using a gas stove and can modulate heat on the fly. | |
Tools you'll need: | |
- a good knife (or whatever you like to chop with) | |
- a wok | |
- a pot for making the noodles | |
Ingredients: |
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 Dummy { | |
public $foos = array(); | |
public function & getFoos() { | |
return $this->foos; | |
} | |
public function addFoo($foo) { |
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 ruby | |
# | |
# Put this script in a bin directory and mark it as executable. | |
# You can now pipe unformatted json files to the script and | |
# pretty printed json will come out the other end. | |
# | |
# Has no external dependencies in Ruby 1.9.x | |
# Requires the json gem in Ruby 1.8.x | |
# | |
require 'json' |
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
say "Hi Khiem this example is for you" |
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
;; Basic integer accumulator. | |
(def acc (atom 0)) | |
(defn accu | |
"Basic implementation of an accumulator. Takes an integer and increments the internal counter by that amount. Returns current counter state." | |
[n] (swap! acc + n) acc) |
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
**THE BEER-WARE LICENSE** | |
<author> wrote this file. As long as you retain this notice youcan do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return. | |
License originally authored by Poul-Henning Kamp (phk). |
OlderNewer