Skip to content

Instantly share code, notes, and snippets.

View simsketch's full-sized avatar
💻
Coding

Elon Zito simsketch

💻
Coding
View GitHub Profile
List the processes running on ports
netstat -a -o -n
Find the one you need. I search for 0.0.0.0:8080 and get the PID.
taskkill /F /PID <pid>
@simsketch
simsketch / rssAjax.html
Created February 27, 2015 14:55
RSS feed non-secure made secure
<div id="rssdata">
<ul class="rss-items"></ul>
<div class="loading">Loading RSS items...</div>
</div>
<script type="text/javascript">
$('#rssdata').ready(function () {
var url = 'http://www.someRSSfeed.com';
$.ajax({
@simsketch
simsketch / videoPlayOnHover
Created February 7, 2015 02:19
Have a video play on hover
// something along that
var vid = document.getElementsByTagName("video");
[].forEach.call(vid, function (item) {
item.addEventListener('mouseover', hoverVideo, false);
item.addEventListener('mouseout', hideVideo, false);
});
function hoverVideo(e)
{
this.play();

Twitter autoresponder bot

By Daniel15 (dan.cx) This is a very simple Twitter autoresponder bot. It requires PECL OAuth extension to be installed (run "pecl install oauth", or if on Windows, grab php-oauth.dll. If using cPanel you can install it via WHM). The authentication is designed for command-line usage, it won't work too well via a web browser. You'll have to sign up for an application on Twitter's site to get the consumer key and secret.

Could be modified to be more advanced (match regular expressions to answer questions, etc.)

Questions? See my blog post - http://dan.cx/blog/2011/06/twitter-autoreply-bot-dbznappa

Modified 2013-06-13 - Twitter API 1.0 discontinued, modified to use Twitter API 1.1

@simsketch
simsketch / trianglifyInit.html
Created September 20, 2014 22:37
trianglifyInit
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="assets/js/trianglify.js"></script>
<script type="text/javascript">
var t = new Trianglify({cellsize:520,noiseIntensity:0,x_gradient:["#800026","#bd0026","#e31a1c","#fc4e2a","#fd8d3c","#feb24c","#fed976"] });
var d = document.getElementById("hero");
var pattern = t.generate(document.body.clientWidth, document.body.clientHeight);
d.setAttribute('style', 'background-image: '+pattern.dataUrl);
</script>
@simsketch
simsketch / removeSound
Created August 14, 2014 19:39
remove sound
<script type="text/javascript">
jQuery( document ).ready(function( $ ) {
$('.container').find('audio, video').each(function(){
this.volume = 0;
});
});
</script>
@simsketch
simsketch / addMin.sql
Created August 6, 2014 17:55
PHPmyAdmin add administrator user in WordPress
INSERT INTO `databasename`.`wp_users` (`ID`, `user_login`, `user_pass`, `user_nicename`, `user_email`, `user_url`, `user_registered`, `user_activation_key`, `user_status`, `display_name`) VALUES ('4', 'demo', MD5('demo'), 'Syed Balkhi', 'test@yourdomain.com', 'http://www.wpbeginner.com/', '2011-06-07 00:00:00', '', '0', 'Syed Balkhi');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO `databasename`.`wp_usermeta` (`umeta_id`, `user_id`, `meta_key`, `meta_value`) VALUES (NULL, '4', 'wp_user_level', '10');