Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Karthick Kumar karthickvkumar

🎯
Focusing
View GitHub Profile
@kosiara
kosiara / setup_howto.txt
Last active Apr 21, 2017
Setup Facebook React-native sample (empty) project on Ubuntu
View setup_howto.txt
# author:
# @Bartosz Kosarzycki
#
sudo apt-get install npm
sudo npm install -g react-native-cli
sudo ln -s /usr/bin/nodejs /usr/bin/node
cd /home/user/your/project/path
react-native init AwesomeProject
cd AwesomeProject
@phanan
phanan / runner.js
Last active Apr 28, 2020
Record a webpage with PhantomJS and FFMpeg
View runner.js
// Run this from the commandline:
// phantomjs runner.js | ffmpeg -y -c:v png -f image2pipe -r 24 -t 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart output.mp4
var page = require('webpage').create(),
address = 'http://s.codepen.io/phanan/fullembedgrid/YPLewm?type=embed&safe=true&_t=1424767252279',
duration = 3, // duration of the video, in seconds
framerate = 24, // number of frames per second. 24 is a good value.
counter = 0,
width = 500,
height = 500;
@paulkaplan
paulkaplan / fabricBezierCurve.js
Last active May 16, 2020
Cubic bezier curves with fabric.js renderer
View fabricBezierCurve.js
var CubicBezier = function(canvas, opts){
if(!opts) opts = {};
this.start = opts.start || new Vec2(100,100);
this.end = opts.end || new Vec2(400, 400);
this.c1 = opts.c1 || new Vec2(100, 300);
this.c2 = opts.c2 || new Vec2(300, 100);
this.curve = new fabric.Path( this.toSVGPath() );
@cpatrick
cpatrick / folder_upload_test.html
Created Mar 27, 2013
Simple test for folder uploading.
View folder_upload_test.html
<html>
<head>
<title>HTML5 Folder Upload Test</title>
</head>
<body>
<div id="container">
<input type="file" id="file_input" name="file_input_folder[]"
multiple webkitdirectory="" mozdirectory="true" directory="" />
</div>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
@zensh
zensh / memorySizeOfObject.js
Created Feb 18, 2013
calculate memory size of javascript object, it is not a accurate value!
View memorySizeOfObject.js
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
break;
case 'string':
@revolunet
revolunet / lzw_encoder.js
Created Feb 25, 2011
LZW javascript compress/decompress
View lzw_encoder.js
// LZW-compress a string
function lzw_encode(s) {
var dict = {};
var data = (s + "").split("");
var out = [];
var currChar;
var phrase = data[0];
var code = 256;
for (var i=1; i<data.length; i++) {
currChar=data[i];
You can’t perform that action at this time.