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 React from 'react'; | |
import {Dimensions} from 'react-native'; | |
import Animated, { | |
Value, | |
useCode, | |
block, | |
cond, | |
eq, |
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 page = require('webpage').create(); | |
page.paperSize = { | |
format: 'A4', | |
orientation: 'portrait', | |
margin: '1cm', | |
header: { | |
height: "1.2cm", | |
contents: phantom.callback(function(pageNum, numPages) { | |
// return "<p>Header <span style='float:right'>" + pageNum + " / " + numPages + "</span></p>"; |
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
// find the smallest number divisible by 1..20 | |
package main | |
import "log" | |
func main() { | |
var i int = 1 | |
for { | |
count := 0 | |
for x := 1; x <= 20; x++ { |
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 main | |
import ( | |
"net/http" | |
"encoding/json" | |
"io/ioutil" | |
"log" | |
"fmt" | |
) |
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 main | |
import ( | |
"net/http" | |
"encoding/json" | |
"log" | |
) | |
type Person struct { | |
Name string `json:"name"` |
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
require 'RMagick' | |
TOP_N = 10 # Number of swatches | |
# Create a 1-row image that has a column for every color in the quantized | |
# image. The columns are sorted decreasing frequency of appearance in the | |
# quantized image. | |
def sort_by_decreasing_frequency(img) | |
hist = img.color_histogram | |
# sort by decreasing frequency |