Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/sh
rm -rf "$HOME/Library/Preferences/WebIde40"
rm -rf "$HOME/Library/Caches/WebIde40"
rm -rf "$HOME/Library/Application Support/WebIde40"
rm -rf "$HOME/Library/Logs/WebIde40"
/**
* @brief copyDir
* @param src
* @param dest
* @return bool
*
* Authors: wysota , Yash
* http://kineticwing.com
*
* License Apache 2.0
@codeyash
codeyash / 0_reuse_code.js
Created August 21, 2014 12:30
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
/**
* @brief executeQueriesFromFile Read each line from a .sql QFile
* (assumed to not have been opened before this function), and when ; is reached, execute
* the SQL gathered until then on the query object. Then do this until a COMMIT SQL
* statement is found. In other words, this function assumes each file is a single
* SQL transaction, ending with a COMMIT line.
*/
void executeQueriesFromFile(QFile *file, QSqlQuery *query)
{
<?php
class DocBlock {
public $docblock,
$description = null,
$all_params = array();
/**
* Parses a docblock;
@codeyash
codeyash / gist:90e15d9a78e2c9c45cd0
Created April 2, 2015 18:09
Using variables from project file (.pro) into C++ code
http://qtway.blogspot.in/2013/04/using-variables-from-project-file-pro.html
Have you ever wonder if any of the variables you have defined in your project file (.pro) can be used in your C++ source code? The answer is yes, and the process is straightforward.
Let's say you export the variables in the project file as macros (in this case you set the target name for the application), then using it from C++ is just simple.
In the project file (.pro)
TARGET = YourApp
TEMPLATE = app
DEFINES += TARGET=\\\"$TARGET\\\"
//- As you may know, Laravel 5 provides the Elixir to compile assets with no pain.
These mixins is for those of you who want to use Jade power combined with that of Laravel Blade.
The syntax mimic Blade statements, however identation differs in some cases.
- var newline = "\r\n"
- var loopIterator = '$iterator'
//- @extends mixin
Example: +extends('layouts/master')
Compiled: @extends('layouts/master')

Getting Started with NPM (as a developer)

If you haven't already set your NPM author info, now you should:

npm set init.author.name "Your Name"
npm set init.author.email "[email protected]"
npm set init.author.url "http://yourblog.com"

npm adduser

@codeyash
codeyash / xml.py
Created September 23, 2015 13:42 — forked from chrisguitarguy/xml.py
Parse an XML sitemap with Python, requests and BeautifulSoup
from __future__ import with_statement # we'll use this later, has to be here
from argparse import ArgumentParser
import requests
from BeautifulSoup import BeautifulStoneSoup as Soup
def parse_sitemap(url):
resp = requests.get(url)
# we didn't get a valid response, bail
@codeyash
codeyash / Information
Created March 29, 2016 18:41 — forked from lamprosg/Information
Qt - Multithreaded Server
Create 2 classes.
One class for the server:
We call it ex. MyServer, with Base class QTcpServer
Second class, every connection will have a new thread:
We call it MyThread, with Base class QThread