Skip to content

Instantly share code, notes, and snippets.

View alt332's full-sized avatar

Thiha Tun alt332

View GitHub Profile
@alt332
alt332 / ImageView.js
Last active May 20, 2020 04:57
Sample For pinch gesture zooming
import React from 'react';
import {Dimensions} from 'react-native';
import Animated, {
Value,
useCode,
block,
cond,
eq,
@alt332
alt332 / pdf.js
Created October 31, 2017 07:52
Make PDF from given URL using PhantomJS
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>";
// 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++ {
@alt332
alt332 / read.go
Last active October 25, 2015 11:00
package main
import (
"net/http"
"encoding/json"
"io/ioutil"
"log"
"fmt"
)
package main
import (
"net/http"
"encoding/json"
"log"
)
type Person struct {
Name string `json:"name"`
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