Skip to content

Instantly share code, notes, and snippets.

@haintwork
haintwork / add-registry.iss
Last active September 20, 2017 04:06
[Inno Setup Script examples] #inno_setup
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
AppName=Test
AppVersion=1.0
;AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\Test
;DefaultGroupName={#MyAppName}
;OutputDir=..\Setup
@haintwork
haintwork / gist-upload-image.md
Last active August 16, 2017 03:54
How do you upload images to a gist?
  1. Create a gist or reuse one of your gists.
  2. Clone your gist:
git clone https://gist.github.com/<hash>.git
  1. Add your image to your gist's repository:
git add my-image.jpg
  1. Commit the image:
@haintwork
haintwork / angularjs-http-status.js
Last active November 5, 2017 23:35
[Angularjs continue processing based on HTTP status response] #angular #response
$http.get(url).then(function(response){
console.log(response.status); //successful status like OK
}, function(response){
console.log(response.status); //error status like 400-Bad Request
})
@haintwork
haintwork / ReadExcelDemo.java
Last active June 3, 2018 02:12
Read/Write excel file in java
package com.howtodoinjava.demo.poi;
//import statements
public class ReadExcelDemo
{
public static void main(String[] args)
{
try
{
FileInputStream file = new FileInputStream(new File("howtodoinjava_demo.xlsx"));
@haintwork
haintwork / c#-image-crop.cs
Last active September 6, 2017 15:21
[Image crop in C#] #image_crop
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace ConsoleApplication1
{
class Program
@haintwork
haintwork / android-studio-simulator-cmmands.md
Last active June 24, 2017 16:32
Android Studio Simulator Commands

Start simulator

emulator -avd <simu_name>
@haintwork
haintwork / mysql-root-get-back-all-privileges.md
Last active June 21, 2017 07:31
How to get all privileges back to the root user in MySQL?

If you cant acces to mysql server as a root you should delete or cannot restore all root records in mysql.user table, delete all of them and add a new record.

You should use mysql PASSWORD() function to hash your cleartext password. check for more information http://dev.mysql.com/doc/refman/5.1/en/password-hashing.html

First stop mysql server and launch mysqld with --skip-grant-tables.

[root@mysql ~]# service mysqld stop; mysqld_safe --skip-grant-tables

Then hash your cleartext password.

@haintwork
haintwork / start-wildfly-standalone-ful-xml.md
Created June 20, 2017 04:15
How to start WildFly as a service with standalone-full.xml?
@haintwork
haintwork / ignore-ssl-gist-clone.md
Last active June 20, 2017 03:48
Ignore SSL while cloning Gist/Git
@haintwork
haintwork / atom-proxy-config.md
Created June 19, 2017 07:17
Atom Proxy Configuration