Skip to content

Instantly share code, notes, and snippets.

View karthickvkumar's full-sized avatar
🎯
Focusing

Karthick Kumar karthickvkumar

🎯
Focusing
View GitHub Profile
@kosiara
kosiara / setup_howto.txt
Last active April 21, 2017 03:42
Setup Facebook React-native sample (empty) project on Ubuntu
# 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 September 22, 2022 11:05
Record a webpage with PhantomJS and FFMpeg
// 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 February 2, 2024 08:30
Cubic bezier curves with fabric.js renderer
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 March 27, 2013 18:06
Simple test for folder uploading.
<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>
@revolunet
revolunet / lzw_encoder.js
Created February 25, 2011 14:55
LZW javascript compress/decompress
// 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];