Skip to content

Instantly share code, notes, and snippets.

View giver's full-sized avatar

Tanin Srivaraphong giver

View GitHub Profile
@giver
giver / nerd_fonts.md
Created March 17, 2024 08:45 — forked from davidteren/nerd_fonts.md
Install Nerd Fonts via Homebrew [updated & fixed]
#!/usr/bin/python
from impacket import smb
from struct import pack
import os
import sys
import socket
'''
EternalBlue exploit by sleepya
The exploit might FAIL and CRASH a target system (depended on what is overwritten)
@giver
giver / 0_reuse_code.js
Created June 28, 2016 02:53
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
$deviceToken = '**********************';
$payload['aps'] = array('alert' => 'My Arabic text', 'badge' => 1, 'sound' => 'default');
$payload = json_encode($payload);
$passphrase = '***';
$apnsHost = 'gateway.sandbox.push.apple.com'; $apnsPort = 2195; $apnsCert = 'ck.pem';
$streamContext = stream_context_create(); stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert);
stream_context_set_option($streamContext, 'ssl', 'passphrase',$passphrase );
$apns = stream_socket_client('ssl://' . $apnsHost . ':' . $apnsPort, $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext);
@giver
giver / continuous_file_writer.js
Created August 29, 2013 06:48
Continuous HTML5 FileWriter to prevent unexpected behavior happen when asynchronous call
/*
* Copyright (C) 2011 Wolfgang Koller
*
* This file is part of GOFG Sports Computer - http://www.gofg.at/.
*
* GOFG Sports Computer is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
@giver
giver / sorted_array.rb
Last active December 21, 2015 16:09 — forked from ryanlecompte/sorted_array.rb
Implement sorted array that always sort when has new data inserted.
require 'delegate'
# SortedArray is backed by a binary search when inserting elements
# via #<< as well as querying for an element with #include?
#
# Example:
# a = SortedArray.new
# 10.times { a << rand(100) }
# puts a # => [3, 24, 30, 40, 42, 43, 49, 67, 81, 88]
# a.include?(49) # => true
@giver
giver / ubuntu_rails_install.rb
Created February 2, 2012 10:55 — forked from JangoSteve/ubuntu_rails_install.rb
Capistrano script to install Ruby, RVM, Rails in ubuntu (modified from deploy.rb scripts)
namespace :ubuntu do
desc "Setup Environment"
task :setup_env, :roles => :app do
update_apt_get
install_dev_tools
install_git
install_subversion
install_sqlite3
# Install and setup RVM instead of old Rails stack
#install_rails_stack
@giver
giver / annoying.js
Created September 13, 2011 04:35 — forked from Kilian/annoying.js
How to be an asshole
/**
* Annoying.js - How to be an asshole to your users
*
* DO NOT EVER, EVER USE THIS.
*
* Copyright (c) 2011 Kilian Valkhof (kilianvalkhof.com)
* Visit https://gist.github.com/767982 for more information and changelogs.
* Visit http://kilianvalkhof.com/2011/javascript/annoying-js-how-to-be-an-asshole/ for the introduction and weblog
* Check out https://gist.github.com/942745 if you want to annoy developer instead of visitors
*