Skip to content

Instantly share code, notes, and snippets.

View HoussemNasri's full-sized avatar

Houssem Nasri HoussemNasri

  • Frankfurt, Germany
View GitHub Profile
Spinner spinner = (Spinner)findViewById(R.id.mySpinner);
List<String> list = Arrays.asList(getResources().getStringArray(R.array.state));
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, list);
spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(spinnerAdapter);
spinnerAdapter.add("DELHI");
spinnerAdapter.notifyDataSetChanged();
import javax.swing.*;
public class GUI {
public static void runGui() {
System.out.println("----------------------- Hello From GUI -----------------------");
String strObjectMass = JOptionPane.showInputDialog(null, "Enter Object Mass");
double objectMass = 0.0;
try {
import glob
import os
import sys
from os import path
from os.path import expanduser
# CLion Activator v1.2
# By congard
# https://github.com/congard
# http://congard.pp.ua/support-me
package com.example;
import java.util.Stack;
public class Main {
public static final char OPENING_PARENTHESES = '(';
public static final char CLOSING_PARENTHESES = ')';
public static void swap(char[] string, int i, int j) {
@HoussemNasri
HoussemNasri / AudioDataSource.kt
Last active May 26, 2020 14:27
Android : fetch all music on device
import android.content.Context
import android.database.Cursor
import android.provider.MediaStore
import android.util.Log
class AudioDataSource {
companion object {
fun getAllAudioFromDevice(context: Context): List<AudioModel> {
val tempAudioList: MutableList<AudioModel> = ArrayList()
import java.util.List;
import java.util.ArrayList;
import java.util.*;
class Main {
public static void reversePhrase(String s) {
}
# remove specific file from git cache
git rm --cached filename
# remove all files from git cache
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
@HoussemNasri
HoussemNasri / syntax.s
Created June 26, 2021 23:34 — forked from mishurov/syntax.s
AT&T assembly syntax and IA-32 instructions
# --------
# Hardware
# --------
# Opcode - operational code
# Assebly mnemonic - abbreviation for an operation
# Instruction Code Format (IA-32)
# - Optional instruction prefix
# - Operational code

Ignore tracked file in git

  1. Add folder/** to .gitignore
  2. Run in the terminal git rm -r --cached folder
  3. Commit and Push

Include Ignored file

  1. Remove file from .gitignore
  2. Run in the terminal git rm -r --cached folder
  3. Run in the terminal git add file
  4. Commit and Push
@HoussemNasri
HoussemNasri / git-commit-title-first-word.md
Created January 31, 2022 17:15 — forked from scmx/git-commit-title-first-word.md
Example list of verbs / first word to use in git commit title #git #commit #title

Example list of first words to use in a git commit title

I like writing well-formed git commits that explain the intention behind why a code change was made.

Check out Chris Beams excellent How to Write a Git Commit Message if you haven't read it.

Anyway, for a project I've been working on I've gathered up 900+ commits that hold up a pretty high quality (except for one 😁). Let's look at some trends about these commits!

Most common first words in commit titles of a project