Skip to content

Instantly share code, notes, and snippets.

View salvatorecapolupo's full-sized avatar
🎯
Focusing

Salvatore Capolupo salvatorecapolupo

🎯
Focusing
View GitHub Profile
@gokulkrishh
gokulkrishh / media-query.css
Last active April 26, 2024 10:32
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@trevex
trevex / scraper.js
Created August 25, 2015 19:56
simple web scraper to download the audio from gamemusic.siroro.co.uk/
var request = require("request"),
cheerio = require("cheerio"),
root = "http://gamemusic.siroro.co.uk/";
function process(url, dir) {
request(url, function(error, response, body) {
if (!error) {
var $ = cheerio.load(body),
filenames = $("span.file-name"),
alert = $("div.alert")[0];
@mbbx6spp
mbbx6spp / ALTERNATIVES.adoc
Last active April 25, 2024 15:14
Super quick list of alternatives to Jira and/or Confluence, Stash, Crucible, etc.
@salvatorecapolupo
salvatorecapolupo / Coffescript -> JS conversion
Last active June 29, 2016 16:13
coffeescript basic: how to install and basic massive compiling
# Using Mac you will need importing cooffe-script library:
sudo npm install -g coffee-script
# now you can convert cooffee-scripts ("compressed" version of a normal javascript file) into more familiar JS, i.e
coffee -c --output gamejs/ game/
#which converts all file into game/ in a new directory called gamejs/.
@danielpataki
danielpataki / ajax-action.php
Last active March 15, 2018 16:22
Ajax in WordPress
add_action( 'wp_ajax_button_click', 'user_clicked' );
function user_clicked() {
update_user_meta( get_current_user_id(), 'clicked_link', 'yes' );
wp_redirect( $_SERVER['HTTP_REFERER'] );
exit();
}
@imath
imath / bp-custom.php
Created September 18, 2014 22:26
add BuddyPress auto suggest mention feature in bbPress.
<?php
/** You could put this in the bp-custom.php file
* @see http://codex.buddypress.org/themes/bp-custom-php/
*/
function custom_bbpress_maybe_load_mentions_scripts( $retval = false ) {
if ( function_exists( 'bbpress' ) && is_bbpress() ) {
$retval = true;
}
return $retval;
@patrickhammond
patrickhammond / android_instructions.md
Last active March 29, 2024 20:14
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@irazasyed
irazasyed / spintax.php
Last active February 21, 2024 17:29
PHP: Text Spinner Class - Nested spinning supported.
<?PHP
/**
* Spintax - A helper class to process Spintax strings.
*/
class Spintax
{
/**
* Set seed to make the spinner predictable.
*/
@technoknol
technoknol / wp-create-own-shortcode.php
Created January 27, 2014 06:50
wordpress create your own shortcode.
<?php
/********************************
This code will allow you to create your own shortcode.
*************************************/
// SHORTCODE FOR GOOGLE ADSENSE
@hissy
hissy / gist:7352933
Created November 7, 2013 11:07
[WordPress] Add file to media library programmatically
<?php
$file = '/path/to/file.png';
$filename = basename($file);
$upload_file = wp_upload_bits($filename, null, file_get_contents($file));
if (!$upload_file['error']) {
$wp_filetype = wp_check_filetype($filename, null );
$attachment = array(
'post_mime_type' => $wp_filetype['type'],
'post_parent' => $parent_post_id,